-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slender object detection only has low PR and mAP #4030
Comments
👋 Hello @Yanhui-He, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started: $ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@Yanhui-He you may need to relax the box candidate criteria here to allow higher aspect ratio labels. The default is 20, you could raise this to 100 for example for extremely thin objects: Lines 266 to 271 in b7e985e
|
@Yanhui-He ah I see you already raise the limit. In this case you may simply need to train at higher resolution to capture more pixels in the short dimension, i.e. train at --img 1280 or 2560. Remember also that YOLOv5 is designed for COCO-like objects, if your use case relies highly on high AR objects you may want to modify the convolutions in the C3 layers from 3x3 to alternating 1x9 and 9x1 for example. |
@glenn-jocher I used --img-size 1472 to train the model, and test the model in 1920 resolution images. Moreover, I try to use DWConv to replace Conv module. However, the recall and mAP@.5 is less than 50%. And I don't konw how to change the convolutions in the C3 layers. For example:
but that is wrong. Oh, To improve the performence, I widen the pole's label width. (original label width * 2), which can improve the precision. Currently, the precision is 80% where the confidence is 0.5. Meawhile, I changed the objectness in loss.py:
It can improve the object confidence when detecting and testing. Therefore, all of my result is testing in the 0.5 confidence. |
See CrossConv module as an example. You could update this to 5,1 and 1,5 for example |
Thanks for your reply. I will try to use the CrossConv in the C3 module. |
👋 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. Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
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! Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐! |
Yolov5 is a wonderful work in object detection. I used it in pedestrian detection and vehicle detection, which has great pweformence. However, when I try to use yolov5 to detect the pole-like object, such as light pole, traffic pole, wire pole, and sign pole, the model has a poor performence.
Note: I only want to detect single class that is pole.
I have changed the ratio of width and height in ddateset.py (the max ar_thr is 63 in my own dataset):
def box_candidates(box1, box2, wh_thr=1, ar_thr=100, area_thr=0.1, eps=1e-16):
On the other hand, the custom data set has more than 9000 pole labels. So I think the dataset is enough to train the model.
The result is: Precison = 68.8, Recall = 36.0, mAP@.5 = 26.8.
I also find a paper that report the slender detection: (https://arxiv.org/abs/2011.08529)
This problem has troubled me for a long time, please help me or give me some enlightenment.
The text was updated successfully, but these errors were encountered: