Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fix icevision default CLI (#1306)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris authored Apr 22, 2022
1 parent ed980a1 commit bd62406
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Fixed a bug where the backbone would not be frozen when finetuning the `QuestionAnswering` task with certain model types ([#1275](https://github.com/PyTorchLightning/lightning-flash/pull/1275))

- Fixed a bug where the default Flash zero configurations for `ObjectDetector`, `InstanceSegmentation`, and `KeypointDetector` would error with the latest version of some requirements ([#1306](https://github.com/PyTorchLightning/lightning-flash/pull/1306))

## [0.7.0] - 2022-02-15

### Added
Expand Down
6 changes: 3 additions & 3 deletions flash/image/detection/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Tuple
from typing import Any, Dict, Optional

from flash.core.data.utils import download_data
from flash.core.utilities.flash_cli import FlashCLI
Expand All @@ -22,7 +22,7 @@

def from_coco_128(
val_split: float = 0.1,
image_size: Tuple[int, int] = (128, 128),
transform_kwargs: Optional[Dict[str, Any]] = None,
batch_size: int = 1,
**data_module_kwargs,
) -> ObjectDetectionData:
Expand All @@ -32,7 +32,7 @@ def from_coco_128(
train_folder="data/coco128/images/train2017/",
train_ann_file="data/coco128/annotations/instances_train2017.json",
val_split=val_split,
transform_kwargs=dict(image_size=image_size),
transform_kwargs=dict(image_size=(128, 128)) if transform_kwargs is None else transform_kwargs,
batch_size=batch_size,
**data_module_kwargs,
)
Expand Down
6 changes: 3 additions & 3 deletions flash/image/instance_segmentation/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from functools import partial
from typing import Callable, Optional, Tuple
from typing import Any, Callable, Dict, Optional

from flash.core.utilities.flash_cli import FlashCLI
from flash.core.utilities.imports import _ICEDATA_AVAILABLE, requires
Expand All @@ -34,8 +34,8 @@ def from_pets(
test_ann_file: Optional[str] = None,
predict_folder: Optional[str] = None,
val_split: float = 0.1,
image_size: Tuple[int, int] = (128, 128),
parser: Optional[Callable] = None,
transform_kwargs: Optional[Dict[str, Any]] = None,
batch_size: int = 1,
**data_module_kwargs,
) -> InstanceSegmentationData:
Expand All @@ -53,7 +53,7 @@ def from_pets(
test_folder=test_folder,
test_ann_file=test_ann_file,
predict_folder=predict_folder,
transform_kwargs=dict(image_size=image_size),
transform_kwargs=dict(image_size=(128, 128)) if transform_kwargs is None else transform_kwargs,
parser=parser,
val_split=val_split,
batch_size=batch_size,
Expand Down
6 changes: 3 additions & 3 deletions flash/image/keypoint_detection/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Callable, Optional, Tuple
from typing import Any, Callable, Dict, Optional

from flash.core.utilities.flash_cli import FlashCLI
from flash.core.utilities.imports import _ICEDATA_AVAILABLE, requires
Expand All @@ -33,8 +33,8 @@ def from_biwi(
test_ann_file: Optional[str] = None,
predict_folder: Optional[str] = None,
val_split: float = 0.1,
image_size: Tuple[int, int] = (128, 128),
parser: Optional[Callable] = None,
transform_kwargs: Optional[Dict[str, Any]] = None,
batch_size: int = 1,
**data_module_kwargs,
) -> KeypointDetectionData:
Expand All @@ -53,7 +53,7 @@ def from_biwi(
test_ann_file=test_ann_file,
predict_folder=predict_folder,
val_split=val_split,
transform_kwargs=dict(image_size=image_size),
transform_kwargs=dict(image_size=(128, 128)) if transform_kwargs is None else transform_kwargs,
batch_size=batch_size,
parser=parser,
**data_module_kwargs,
Expand Down

0 comments on commit bd62406

Please sign in to comment.