tryolabs / norfair

Lightweight Python library for adding real-time multi-object tracking to any detector.

Home Page:https://tryolabs.github.io/norfair/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yolov5 demo.py

Lukasjai opened this issue · comments

I wanted to use your demo and test it for my object tracking problem but i have problems to use my own trained model. I have a video of someone filming a dragon fruit plantation, with the yolov5m6 you integrated even some things are recognized. However, if I now use my self-trained model, i.e. the best.pt, I get no results. As a pure object detection my model works very well and recognizes 90-99% of all fruits in the video.
What i changed in your demo code

  1. loading the model
    self.model = torch.hub.load("path to my yolo repo", 'custom', path="path to best.py")
  2. Argument Parser for the model name
    deleted the default yolov5m6

I have run your code in a Python virtual environment

My model was created with Yolov5 version 7.0 and it has 3 different classes to detect.

The code runs but the output video does not contain any object tracking or any kind of markers in the video. Do you have a solution for this? especially to load the new weights.

Hi @Lukasjai! I believe I don't fully understand the situation. Are you getting detections from your model? Are those detections the ones you expect? If not, you may be having some problems loading the custom model. We usually load it with self.model = torch.hub.load("ultralytics/yolov5", "custom", path=model_path).

If detections are good, then you may want to look at the output of the tracker.update() call to see if there's any TrackedObject being created.

Closing due to inactivity. Please feel free to reopen.