sergio11 / vehicle_detection_tracker

πŸš— VehicleDetectionTracker: Real-time vehicle detection and tracking powered by YOLO. πŸš™πŸš• Enhance your computer vision projects with speed, precision, and adaptability.
https://pypi.org/project/VehicleDetectionTracker/
MIT License
70 stars 15 forks source link

motorcycle not detected #5

Open wimdecorte opened 3 months ago

wimdecorte commented 3 months ago

Motorcycles in a video are not picked up by the detection and I don't see an obvious place to specify which types should be.

I can upload the 20s video clip that I'm processing.

sergio11 commented 3 months ago

Hi @wimdecorte

YOLOv8 is trained on the COCO dataset, which includes motorcycles as one of its predefined classes, so it should be able to detect them without any additional configuration. If motorcycles are not being detected in your video, several factors might be causing this issue:

To address the last point, you can try lowering the confidence threshold in the YOLO model.

Here’s how you can adjust it in your code:

confidence_threshold = 0.3  # Adjust this value as needed
results = self.model.track(self._increase_brightness(frame), persist=True, tracker="bytetrack.yaml", conf=confidence_threshold)

This change allows the model to consider detections with lower confidence scores, which might help in identifying the motorcycles.

Please let me know if this answer help you.