Skip to content

Commit

Permalink
update train
Browse files Browse the repository at this point in the history
  • Loading branch information
cxnt committed Jun 7, 2024
1 parent 69ccc4d commit 709f939
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions supervisely/train/src/sly_train_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import yaml
import supervisely as sly
from supervisely.nn.models.yolov5 import YOLOv5
from supervisely.nn.artifacts.yolov5 import YOLOv5
from supervisely.app.v1.app_service import AppService
from dotenv import load_dotenv

Expand Down Expand Up @@ -57,12 +57,12 @@
sly.logger.info(f"All training artifacts will be saved to local directory {local_artifacts_dir}")

sly_yolov5 = YOLOv5(team_id)
model_dir = sly_yolov5.framework_dir
framework_dir = sly_yolov5.framework_dir

remote_artifacts_dir = os.path.join(model_dir, project_info.name, experiment_name)
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 = os.path.join(remote_artifacts_dir, sly_yolov5.weights_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}")
11 changes: 6 additions & 5 deletions supervisely/train/src/sly_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ def _gen_message(current, total):
time.sleep(0.5)

# generate metadata
globals.sly_yolov5.generate_sly_metadata(
globals.sly_yolov5.generate_metadata(
app_name=globals.sly_yolov5.app_name,
session_id=globals.experiment_name,
session_path=globals.remote_artifacts_dir,
weights_path=globals.remote_weights_dir,
training_project_name=globals.project_info.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,
)

0 comments on commit 709f939

Please sign in to comment.