detected motorcyclist issues #19412
Replies: 2 comments
-
👋 Hello @JanuwaPutra, thank you for sharing your question and interest in Ultralytics 🚀! We recommend starting with the Ultralytics Docs for general guidance and reviewing Tips for Best Training Results to refine your training process. For advanced users, the Tasks and Modes sections provide insight into customizing models and workflows. If this is a ❓ custom training-related question, you can improve predictions by providing more details about your dataset, training hyperparameters, and logs. Regarding your issue, it’s significant to ensure your training dataset includes consistent labels that differentiate motorcycle riders from other classes (e.g., "motorcycle" or "person"), and a clear demonstration of your setup might help diagnose the problem. If you believe this is a 🐛 Bug Report, please provide a minimum reproducible example so we can better understand your implementation. Sharing the training scripts or configurations, and the version of To ensure you're working with the latest updates and bug fixes, consider upgrading to the most recent pip install -U ultralytics You might also want to test your scenario in one of the verified environments for YOLO, such as notebooks with free GPUs available here: To connect with the community and exchange insights, feel free to join us on Discord 🎧, Discourse, or the Subreddit. An Ultralytics engineer will review your question soon to assist further 😊. |
Beta Was this translation helpful? Give feedback.
-
@JanuwaPutra for motorcycle rider detection without separate 'person' classification, you can filter overlapping detections in post-processing. Here's a minimal example using your existing YOLOv8x model: from ultralytics import YOLO
model = YOLO('yolov8x.pt')
results = model.predict(source, classes=[0,1,2,3,5]) # 0=person,1=bicycle,2=car,3=motorcycle,5=bus
# Filter out persons overlapping with motorcycles
for result in results:
motorcycles = result.boxes[result.boxes.cls == 3]
persons = result.boxes[result.boxes.cls == 0]
# Remove persons with high IoU overlap with motorcycle bboxes
keep = [i for i, p in enumerate(persons) if not any(p.iou(m).max() > 0.5 for m in motorcycles)]
result.boxes = persons[keep] + motorcycles + result.boxes[result.boxes.cls.isin([1,2,5])] This preserves motorcycle detections while suppressing overlapping person boxes. Adjust the 0.5 IoU threshold as needed for your use case. For more advanced solutions, consider custom training with merged rider classes. |
Beta Was this translation helpful? Give feedback.
-
I want to create pedestrian density and use the classes motorcycle, bicycle, human, bus and car. However, there is a problem with the motorcycle section, namely that the motorcycle rider is also detected as a person. How can the motorcycle rider not be detected as a person? Is it possible? i use yolov8x.pt

Beta Was this translation helpful? Give feedback.
All reactions