From 0b7b9f8d95d85540275e70f41d42aa90422a5c85 Mon Sep 17 00:00:00 2001 From: Pavel Bartsits <48913536+cxnt@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:56:12 +0400 Subject: [PATCH] Update Supervisely version to v6.73.100 (#214) * update train * add reqs * fix typo * update train * update train * update train * update build action * update docker --- dev_requirements.txt | 4 +++- supervisely/serve/config.json | 2 +- supervisely/train/config.json | 2 +- supervisely/train/src/sly_train_globals.py | 11 ++++++++++- supervisely/train/src/sly_utils.py | 14 +++++++++++++- 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index 0b28dd464de6..e97ca50a43cd 100755 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,5 +1,7 @@ +# git+https://github.com/supervisely/supervisely.git@test-branch + # pip install -r requirements.txt -supervisely==6.73.95 +supervisely==6.73.100 opencv-python-headless==4.5.5.62 opencv-python==4.5.5.62 diff --git a/supervisely/serve/config.json b/supervisely/serve/config.json index 9c81f8ad2698..a4a63aa9ebd9 100644 --- a/supervisely/serve/config.json +++ b/supervisely/serve/config.json @@ -11,7 +11,7 @@ "serve" ], "description": "Deploy model as REST API service", - "docker_image": "supervisely/yolov5:1.0.3", + "docker_image": "supervisely/yolov5:1.0.4", "instance_version": "6.8.88", "entrypoint": "python -m uvicorn main:m.app --app-dir ./supervisely/serve/src --host 0.0.0.0 --port 8000 --ws websockets", "port": 8000, diff --git a/supervisely/train/config.json b/supervisely/train/config.json index f7f1f56ab8e0..4130fa701959 100644 --- a/supervisely/train/config.json +++ b/supervisely/train/config.json @@ -10,7 +10,7 @@ "train" ], "description": "Dashboard to configure and monitor training", - "docker_image": "supervisely/yolov5:1.0.3", + "docker_image": "supervisely/yolov5:1.0.4", "min_instance_version": "6.8.70", "main_script": "supervisely/train/src/sly_train.py", "gui_template": "supervisely/train/src/gui.html", diff --git a/supervisely/train/src/sly_train_globals.py b/supervisely/train/src/sly_train_globals.py index 84b6b054246d..3e0e1d16d6e3 100644 --- a/supervisely/train/src/sly_train_globals.py +++ b/supervisely/train/src/sly_train_globals.py @@ -3,6 +3,7 @@ import sys import yaml import supervisely as sly +from supervisely.nn.artifacts.yolov5 import YOLOv5 from supervisely.app.v1.app_service import AppService from dotenv import load_dotenv @@ -54,6 +55,14 @@ experiment_name = str(task_id) local_artifacts_dir = os.path.join(runs_dir, experiment_name) sly.logger.info(f"All training artifacts will be saved to local directory {local_artifacts_dir}") -remote_artifacts_dir = os.path.join("/yolov5_train", project_info.name, experiment_name) + +sly_yolov5 = YOLOv5(team_id) +framework_dir = sly_yolov5.framework_folder + +remote_artifacts_dir = os.path.join(framework_dir, project_info.name, experiment_name) remote_artifacts_dir = api.file.get_free_dir_name(team_id, remote_artifacts_dir) + +remote_weights_dir = sly_yolov5.get_weights_path(remote_artifacts_dir) +remote_weights_dir = api.file.get_free_dir_name(team_id, remote_artifacts_dir) + sly.logger.info(f"After training artifacts will be uploaded to Team Files: {remote_artifacts_dir}") diff --git a/supervisely/train/src/sly_utils.py b/supervisely/train/src/sly_utils.py index bba1c326b95d..17dcc2140076 100644 --- a/supervisely/train/src/sly_utils.py +++ b/supervisely/train/src/sly_utils.py @@ -66,4 +66,16 @@ def _gen_message(current, total): globals.api.file.upload(globals.team_id, local_path, remote_path, lambda monitor: progress_cb(progress_last + monitor.bytes_read)) progress.message = _gen_message(idx + 1, len(local_files)) - time.sleep(0.5) \ No newline at end of file + time.sleep(0.5) + + # generate metadata + globals.sly_yolov5.generate_metadata( + app_name=globals.sly_yolov5.app_name, + task_id=globals.experiment_name, + artifacts_folder=globals.remote_artifacts_dir, + weights_folder=globals.remote_weights_dir, + weights_ext=globals.sly_yolov5.weights_ext, + project_name=globals.project_info.name, + task_type=globals.sly_yolov5.task_type, + config_path=None, + )