Spaces:
Running
Running
path issue fix
Browse files
comic_panel_extractor/train.py
CHANGED
|
@@ -119,7 +119,7 @@ def main():
|
|
| 119 |
|
| 120 |
# Backup best weights
|
| 121 |
weights_path = yolo_manager.get_best_weights_path()
|
| 122 |
-
backup_path = f'{Config.YOLO_MODEL_NAME}.pt'
|
| 123 |
backup_file(weights_path, backup_path)
|
| 124 |
|
| 125 |
print("π Training completed successfully!")
|
|
|
|
| 119 |
|
| 120 |
# Backup best weights
|
| 121 |
weights_path = yolo_manager.get_best_weights_path()
|
| 122 |
+
backup_path = f'{Config.current_path}/{Config.YOLO_MODEL_NAME}.pt'
|
| 123 |
backup_file(weights_path, backup_path)
|
| 124 |
|
| 125 |
print("π Training completed successfully!")
|
comic_panel_extractor/yolo_manager.py
CHANGED
|
@@ -135,7 +135,7 @@ class YOLOManager:
|
|
| 135 |
def get_best_weights_path(self, run_name: Optional[str] = None) -> str:
|
| 136 |
"""Get path to best trained weights."""
|
| 137 |
run_name = run_name or self.model_name
|
| 138 |
-
weights_path = os.path.join('runs', 'detect', run_name, 'weights', 'best.pt')
|
| 139 |
|
| 140 |
if not os.path.isfile(weights_path):
|
| 141 |
raise FileNotFoundError(f"β Trained weights not found at: {weights_path}")
|
|
|
|
| 135 |
def get_best_weights_path(self, run_name: Optional[str] = None) -> str:
|
| 136 |
"""Get path to best trained weights."""
|
| 137 |
run_name = run_name or self.model_name
|
| 138 |
+
weights_path = os.path.join(Config.current_path, 'runs', 'detect', run_name, 'weights', 'best.pt')
|
| 139 |
|
| 140 |
if not os.path.isfile(weights_path):
|
| 141 |
raise FileNotFoundError(f"β Trained weights not found at: {weights_path}")
|