Skip to content

Commit

Permalink
detailer add ultralytics version
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Mandic <[email protected]>
  • Loading branch information
vladmandic committed Nov 4, 2024
1 parent 363e7ba commit 6306aab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/postprocess/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ def load(self, model_name: str = None):
try:
model_file = modelloader.load_file_from_url(url=model_url, model_dir=shared.opts.yolo_dir, file_name=file_name)
if model_file is not None:
from ultralytics import YOLO # pylint: disable=import-outside-toplevel
model = YOLO(model_file)
import ultralytics
model = ultralytics.YOLO(model_file)
classes = list(model.names.values())
shared.log.info(f'Load: type=Detailer name="{model_name}" model="{model_file}" classes={classes}')
shared.log.info(f'Load: type=Detailer name="{model_name}" model="{model_file}" ultralytics={ultralytics.__version__} classes={classes}')
self.models[model_name] = model
return model_name, model
except Exception as e:
Expand Down

0 comments on commit 6306aab

Please sign in to comment.