mikel-brostrom / boxmot

BoxMOT: pluggable SOTA tracking modules for segmentation, object detection and pose estimation models
GNU Affero General Public License v3.0
6.7k stars 1.71k forks source link

Can't use my custom YOLO-NAS model #914

Closed MrChains closed 1 year ago

MrChains commented 1 year ago

Search before asking

Yolv8 Tracking Component

Tracking

Bug

I have been trying for a while but any time I run the program it redownloads yolov8s.pt and I can tell its not what I made, it even uses classes that it has not been trained on.

track: yolo_model=/home/dpi-jorge/tracker/yolo_tracking/examples/weights/yolo_nas_s.pt, reid_model=/home/dpi-jorge/tracker/yolo_tracking/examples/weights/mobilenetv2_x1_4_dukemtmcreid.pt, tracking_method=bytetrack, source=/home/dpi-jorge/tracker/yolo_tracking/videos/2023-05-04-12-11-32.mp4, imgsz=[640], conf=0.4, iou=0.5, device=, show=True, save=False, classes=None, project=/home/dpi-jorge/tracker/yolo_tracking/runs/track, name=exp, exist_ok=False, half=False, vid_stride=1, hide_label=False, hide_conf=False, save_txt=False The console stream is logged into /home/dpi-jorge/sg_logs/console.log [2023-05-29 17:15:27] INFO - crash_tips_setup.py - Crash tips is enabled. You can set your environment variable to CRASH_HANDLER=FALSE to disable it /home/dpi-jorge/.local/lib/python3.10/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") [2023-05-29 17:15:29] WARNING - init.py - Failed to import pytorch_quantization [2023-05-29 17:15:29] WARNING - calibrator.py - Failed to import pytorch_quantization [2023-05-29 17:15:29] WARNING - export.py - Failed to import pytorch_quantization [2023-05-29 17:15:29] WARNING - selective_quantization_utils.py - Failed to import pytorch_quantization [2023-05-29 17:15:29] INFO - checkpoint_utils.py - License Notification: YOLO-NAS pre-trained weights are subjected to the specific license terms and conditions detailed in https://github.com/Deci-AI/super-gradients/blob/master/LICENSE.YOLONAS.md By downloading the pre-trained weight files you agree to comply with these terms. task=detect mode=train model=yolov8n.pt data=coco.yaml epochs=100 patience=50 batch=16 imgsz=[640, 640] save=False save_period=-1 cache=False device= workers=8 project=/home/dpi-jorge/tracker/yolo_tracking/runs/track name=exp exist_ok=False pretrained=False optimizer=SGD verbose=True seed=0 deterministic=True single_cls=False rect=False cos_lr=False close_mosaic=0 resume=False amp=True overlap_mask=True mask_ratio=4 dropout=0.0 val=True split=val save_json=False save_hybrid=False conf=0.4 iou=0.5 max_det=300 half=False dnn=False plots=True source=/home/dpi-jorge/tracker/yolo_tracking/videos/2023-05-04-12-11-32.mp4 show=True save_txt=False save_conf=False save_crop=False show_labels=True show_conf=True vid_stride=1 line_width=None visualize=False augment=False agnostic_nms=False classes=None retina_masks=False boxes=True format=torchscript keras=False optimize=False int8=False dynamic=False simplify=False opset=None workspace=4 nms=False lr0=0.01 lrf=0.01 momentum=0.937 weight_decay=0.0005 warmup_epochs=3.0 warmup_momentum=0.8 warmup_bias_lr=0.1 box=7.5 cls=0.5 dfl=1.5 pose=12.0 kobj=1.0 label_smoothing=0.0 nbs=64 hsv_h=0.015 hsv_s=0.7 hsv_v=0.4 degrees=0.0 translate=0.1 scale=0.5 shear=0.0 perspective=0.0 flipud=0.0 fliplr=0.5 mosaic=1.0 mixup=0.0 copy_paste=0.0 cfg=None v5loader=False tracker=botsort.yaml yolo_model=/home/dpi-jorge/tracker/yolo_tracking/examples/weights/yolo_nas_s.pt reid_model=/home/dpi-jorge/tracker/yolo_tracking/examples/weights/mobilenetv2_x1_4_dukemtmcreid.pt tracking_method=bytetrack hide_label=False hide_conf=False tracking_config=/home/dpi-jorge/tracker/yolo_tracking/boxmot/bytetrack/configs/bytetrack.yaml qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "/usr/local/lib/python3.10/dist-packages/cv2/qt/plugins" video 1/1 (1/2278) /home/dpi-jorge/tracker/yolo_tracking/videos/2023-05-04-12-11-32.mp4: 384x640 6 cars, YOLO 654.5ms, TRACKING 1.0ms

Thanks for your help, this could really speed up my project on traffic detection.

Environment

Python 3.10.6 latest install of your repo

Minimal Reproducible Example

python3 examples/track.py --yolo-model yolo_nas_s --source /home/dpi-jorge/tracker/yolo_tracking/videos/2023-05-04-12-11-32.mp4

mikel-brostrom commented 1 year ago

As you can see here:

https://github.com/mikel-brostrom/yolo_tracking/blob/b2f11989205b2a55d853f61e3c07a99d172046e3/examples/multi_yolo_backend.py#L22-L25

thee multi-yolo backend only allows for pretrained models at the moment. I couldn't find a good example in SG's documentation. Feel free to leave a PR for custom YOLO-NAS model loading.

MrChains commented 1 year ago

I see, thank you

flo-crn commented 1 year ago

I had the same issue : when I tried to put my yolo trained model on the tracking , it downloaded the "default version". So to fool it, I just changed my model name by "yolov8l.pt" in the same folder that the default version, so it takes my weights. I don't know if this is exactly your issue

mikel-brostrom commented 1 year ago

I am on it but need a response from the SG developers here: https://github.com/Deci-AI/super-gradients/issues/1099. If more people ask and push them, the sooner it will be answered I guess.

github-actions[bot] commented 1 year ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!