From f7e3423cc7591bc02b4f23bb0369516dc8bd0906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=85=E7=80=AC=E9=81=BC=E5=B9=B3?= Date: Mon, 22 Jan 2024 20:50:12 +0900 Subject: [PATCH 1/3] feat: api resize option --- README.md | 7 +++++-- fastlabel/__init__.py | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aa7af29..1dbd0a5 100644 --- a/README.md +++ b/README.md @@ -3093,9 +3093,12 @@ Get training jobs. ```python training_job = client.execute_training_job( dataset_name="dataset_name", - base_model_name="fastlabel_object_detection_light", // "fastlabel_object_detection_light" or "fastlabel_object_detection_high_accuracy" + base_model_name="fastlabel_object_detection_light", // "fastlabel_object_detection_light" or "fastlabel_object_detection_high_accuracy" or "fastlabel_u_net_general" epoch=300, - use_dataset_train_val=True + use_dataset_train_val=True, + resize_option="fixed", // "fixed" or "none" + resize_width=1024, + resize_height=1024, ) ``` diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 995ed36..0c84288 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -6,7 +6,7 @@ import re from concurrent.futures import ThreadPoolExecutor from pathlib import Path -from typing import List, Optional, Union +from typing import List, Literal, Optional, Union import aiohttp import cv2 @@ -4248,6 +4248,9 @@ def execute_training_job( instance_type: str = "ml.p3.2xlarge", batch_size: int = None, learning_rate: float = None, + resize_option: str = Literal["fixed", "none"], + resize_height: Optional[int] = None, + resize_width: Optional[int] = None, ) -> list: """ Returns a list of training jobs. @@ -4266,6 +4269,9 @@ def execute_training_job( "instanceType": instance_type, "batchSize": batch_size, "learningRate": learning_rate, + "resizeOption": resize_option, + "resizeHeight": resize_height, + "resizeWidth": resize_width, } return self.api.post_request( From 1d37f23764f0730abc280a2cecafe752c6e5dded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=85=E7=80=AC=E9=81=BC=E5=B9=B3?= Date: Tue, 23 Jan 2024 10:49:26 +0900 Subject: [PATCH 2/3] fix: resize_dimension --- README.md | 5 ++--- fastlabel/__init__.py | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1dbd0a5..31097e0 100644 --- a/README.md +++ b/README.md @@ -3096,9 +3096,8 @@ training_job = client.execute_training_job( base_model_name="fastlabel_object_detection_light", // "fastlabel_object_detection_light" or "fastlabel_object_detection_high_accuracy" or "fastlabel_u_net_general" epoch=300, use_dataset_train_val=True, - resize_option="fixed", // "fixed" or "none" - resize_width=1024, - resize_height=1024, + resize_option="fixed", // optional, "fixed" or "none" + resize_dimension=1024, // optional, 512 or 1024 ) ``` diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 0c84288..f9b687e 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -4249,8 +4249,7 @@ def execute_training_job( batch_size: int = None, learning_rate: float = None, resize_option: str = Literal["fixed", "none"], - resize_height: Optional[int] = None, - resize_width: Optional[int] = None, + resize_dimension: Optional[int] = None, ) -> list: """ Returns a list of training jobs. @@ -4270,8 +4269,7 @@ def execute_training_job( "batchSize": batch_size, "learningRate": learning_rate, "resizeOption": resize_option, - "resizeHeight": resize_height, - "resizeWidth": resize_width, + "resizeDimension": resize_dimension, } return self.api.post_request( From 0b3d9374d286e0c5335be8f4851bee460a4b55c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=85=E7=80=AC=E9=81=BC=E5=B9=B3?= Date: Tue, 23 Jan 2024 10:56:49 +0900 Subject: [PATCH 3/3] debug: resize_option --- fastlabel/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index f9b687e..340ed13 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -4248,7 +4248,7 @@ def execute_training_job( instance_type: str = "ml.p3.2xlarge", batch_size: int = None, learning_rate: float = None, - resize_option: str = Literal["fixed", "none"], + resize_option: Optional[Literal["fixed", "none"]] = None, resize_dimension: Optional[int] = None, ) -> list: """