diff --git a/.github/workflows/sly_build_and_push_image_manual.yml b/.github/workflows/build_image.yml similarity index 50% rename from .github/workflows/sly_build_and_push_image_manual.yml rename to .github/workflows/build_image.yml index 24de3c7f002c..418043aaf28c 100644 --- a/.github/workflows/sly_build_and_push_image_manual.yml +++ b/.github/workflows/build_image.yml @@ -1,10 +1,10 @@ -name: Supervisely Build and Push Image Manual +name: Docker Image Build on: workflow_dispatch: inputs: tag_version: - description: 'Docker Image Tag' + description: 'Docker Image Tag (without "v")' required: true default: '' @@ -12,21 +12,32 @@ jobs: docker: runs-on: ubuntu-latest steps: + - + name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: true - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: push: true file: Dockerfile diff --git a/.github/workflows/manual-build-push-docker-image.yml b/.github/workflows/manual-build-push-docker-image.yml deleted file mode 100644 index 9996dc6a942f..000000000000 --- a/.github/workflows/manual-build-push-docker-image.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Dokcer Image CI - -on: - workflow_dispatch: - inputs: - tag_version: - description: 'Docker Image Tag' - required: true - default: '' - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - file: Dockerfile - tags: supervisely/yolov5:${{ github.event.inputs.tag_version }} 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, + )