From 2895ce81e234e013b8cd008261d19abfa27b31c7 Mon Sep 17 00:00:00 2001 From: yagiryo <“yagi-ryo143@g.ecc.u-tokyo.ac.jp“> Date: Sat, 16 Nov 2024 19:13:13 +0900 Subject: [PATCH] =?UTF-8?q?group=E3=81=94=E3=81=A8=E3=81=AE=E5=86=85?= =?UTF-8?q?=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/src/routes/videos.py | 2 +- py/src/services/train_yolo_model/incremental_learning.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/py/src/routes/videos.py b/py/src/routes/videos.py index 73fef46..f2e898d 100644 --- a/py/src/routes/videos.py +++ b/py/src/routes/videos.py @@ -108,7 +108,7 @@ def upload_video(): # Annotate the video (add bounding boxes and overlay data) overlay_path = f"{PROCESSED_OVERLAY_DIR}/overlay_{video_id}.json" output_path = f"{PROCESSED_DATA_DIR}/videos_with_nametags/{video_filename}.mp4" - model_path = f"{MODELS_DIR}/YOLOv11/{group_name}/hackv4i.pt" + model_path = f"{MODELS_DIR}/YOLOv11/{group_name}/hackv11i.pt" annotate_video(uploaded_video_path, output_path, overlay_path, model_path) # TODO: FIX ME. diff --git a/py/src/services/train_yolo_model/incremental_learning.py b/py/src/services/train_yolo_model/incremental_learning.py index a04b0bc..a77738e 100644 --- a/py/src/services/train_yolo_model/incremental_learning.py +++ b/py/src/services/train_yolo_model/incremental_learning.py @@ -48,10 +48,11 @@ def update_model_with_additional_dataset(DATASETS_DIR, MODELS_DIR, group): key=lambda x: os.path.getctime(os.path.join(runs_dir, x)), ) best_pt_path = os.path.join(runs_dir, latest_train_dir, "weights", "best.pt") + output_path = os.path.join(models_dir, "hackv11i.pt") if os.path.exists(best_pt_path): - shutil.copy(best_pt_path, models_dir) - print(f"best.pt を {best_pt_path} から {models_dir} にコピーしました。") + shutil.copy(best_pt_path, output_path) + print(f"best.pt を {best_pt_path} から {output_path} にコピーしました。") else: print("best.pt ファイルが見つかりませんでした。")