yolov3
yolov3 copied to clipboard
Questions about the label about YOLOV3
Search before asking
- [X] I have searched the YOLOv3 issues and discussions and found no similar questions.
Question
Hello author,
Thanks for your contribution. I have some questions about the label or GT for YOLOV3.
After reviewing the code in loss.py (build_targets and compute loss).
My understanding is as follows:
One GT from label file (annotation txt file) would be converted to be targets in 3 different prediction layers. Then it would be filtered by the ratio which is provided by self.hyp['anchor_t']. So there might be a case that one GT to be converted as a target in different anchors from different layers. When calculating loss, all these targets would be counted.
If I understand correctly, how the model will be learned to predict the correct size?(I know this already has been approved to be True, I just dont understand )
Thanks,
ZD
Additional
No response
👋 Hello @d5423197, thank you for your interest in YOLOv3 🚀! 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://ultralytics.com or email Glenn Jocher at [email protected].
Requirements
Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:
$ git clone https://github.com/ultralytics/yolov3
$ cd yolov3
$ pip install -r requirements.txt
Environments
YOLOv3 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
-
Google Colab and Kaggle notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
-
Docker Image. See Docker Quickstart Guide
Status
If this badge is green, all YOLOv3 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv3 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.
Search before asking
- [x] I have searched the YOLOv3 issues and discussions and found no similar questions.
Question
Hello author,
Thanks for your contribution. I have some questions about the label or GT for YOLOV3.
After reviewing the code in loss.py (build_targets and compute loss).
My understanding is as follows:
One GT from label file (annotation txt file) would be converted to be targets in 3 different prediction layers. Then it would be filtered by the ratio which is provided by self.hyp['anchor_t']. So there might be a case that one GT to be converted as a target in different anchors from different layers. When calculating loss, all these targets would be counted.
If I understand correctly, how the model will be learned to predict the correct size?(I know this already has been approved to be True, I just dont understand )
Thanks,
ZD
Additional
No response
We will caculate the iou.So,although there's 3 feature layers and 9 anchors,the loss between GT and the best predbox is the max one. Just my own opinion
anchors
Hi, I think is no problem for one target matching with varieties of anchors. If wh_iou of GT and anchor much than threshold, we choose the anchor as positive sample.
👋 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 YOLOv3 🚀 resources:
- Wiki – https://github.com/ultralytics/yolov3/wiki
- Tutorials – https://github.com/ultralytics/yolov3#tutorials
- Docs – https://docs.ultralytics.com
Access additional Ultralytics ⚡ resources:
- Ultralytics HUB – https://ultralytics.com/hub
- Vision API – https://ultralytics.com/yolov5
- About Us – https://ultralytics.com/about
- Join Our Team – https://ultralytics.com/work
- Contact Us – https://ultralytics.com/contact
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 YOLOv3 🚀 and Vision AI ⭐!
@KJZhuAutomatic great observation! That's correct, in YOLOv3, when calculating the loss, the model learns to predict the correct size by measuring the Intersection over Union (IoU) between the ground truth (GT) and the best predicted box. This allows for the matching of one target with different anchors, and the anchor with the highest IoU with the GT is selected as the positive sample. Your understanding is spot on. Keep up the great work!