Updating the base model preset

This commit is contained in:
2025-12-11 23:27:02 +02:00
parent dbde07c0e8
commit 9f7d2be1ac

View File

@@ -80,7 +80,8 @@ class YOLOWrapper:
Dictionary with training results Dictionary with training results
""" """
if self.model is None: if self.model is None:
self.load_model() if not self.load_model():
raise RuntimeError(f"Failed to load model from {self.model_path}")
try: try:
logger.info(f"Starting training: {name}") logger.info(f"Starting training: {name}")
@@ -122,7 +123,8 @@ class YOLOWrapper:
Dictionary with validation metrics Dictionary with validation metrics
""" """
if self.model is None: if self.model is None:
self.load_model() if not self.load_model():
raise RuntimeError(f"Failed to load model from {self.model_path}")
try: try:
logger.info(f"Starting validation on {split} split") logger.info(f"Starting validation on {split} split")
@@ -163,7 +165,8 @@ class YOLOWrapper:
List of detection dictionaries List of detection dictionaries
""" """
if self.model is None: if self.model is None:
self.load_model() if not self.load_model():
raise RuntimeError(f"Failed to load model from {self.model_path}")
prepared_source, cleanup_path = self._prepare_source(source) prepared_source, cleanup_path = self._prepare_source(source)
@@ -211,7 +214,8 @@ class YOLOWrapper:
Path to exported model Path to exported model
""" """
if self.model is None: if self.model is None:
self.load_model() if not self.load_model():
raise RuntimeError(f"Failed to load model from {self.model_path}")
try: try:
logger.info(f"Exporting model to {format} format") logger.info(f"Exporting model to {format} format")