ultralytics / yolov3

YOLOv3 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
10.25k stars 3.45k forks source link

Difference of YOLOLayer between v3 and v4 #1884

Closed Tim-Hung closed 2 years ago

Tim-Hung commented 2 years ago

Search before asking

Question

Hello, I'm curious about the differece of YOLOLayer between YOLOv3 and YOLOv4 in forward function:

In models.py of YOLOv3, image

And in models.py of YOLOv4, image

What's the difference of these two kind of inference code? Does it effect the training result?

Additional

No response

github-actions[bot] commented 2 years ago

👋 Hello @Tim-Hung, 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 glenn.jocher@ultralytics.com.

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):

Status

CI CPU testing

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.

glenn-jocher commented 2 years ago

@Tim-Hung the bottom is the current YOLOv5 method for regression computation. It's updated for stability (sigmoid rather than exp) and multiple anchor-target assignment for increased recall. YOLOv4-Scaled inherited this since it's mostly based on earlier versions of YOLOv5.