yolov5 icon indicating copy to clipboard operation
yolov5 copied to clipboard

Yolov5 with attention model

Open ratom opened this issue 2 years ago • 11 comments

Search before asking

  • [X] I have searched the YOLOv5 issues and found no similar feature requests.

Description

I have not found any repo or implementation about transformer and yolov5. Can anyone suggest me the repo and trained weights if any. Most of the information I found were partial not a running or complete repo. Thanks

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

ratom avatar Jul 23 '22 07:07 ratom

👋 Hello @ratom, 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://ultralytics.com or email [email protected].

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 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 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.

github-actions[bot] avatar Jul 23 '22 07:07 github-actions[bot]

@ratom we have a YOLOv5 transformer model here you can use. It's not very popular because the CUDA requirements and training time are super high compared to the baseline models. You can train with i.e.

python train.py --weights yolov5s.pt --cfg yolov5s-transformer.yaml

For details see: https://github.com/ultralytics/yolov5/blob/master/models/hub/yolov5s-transformer.yaml

glenn-jocher avatar Jul 25 '22 23:07 glenn-jocher

I have tested various versions of transformer/attention modules for yolov5. Some did raise a bit of metrics performance in certain types of dataset, but none of them justified the inevitable additional computation and vram cost.

I don't think vision transformers are the next thing to go for. I'd look more forward to ConvNeXt.

Zephyr69 avatar Jul 28 '22 07:07 Zephyr69

@Zephyr69 yes this is the impression I have currently also. I think a big part of the excitement originated from NLP but the transfer of benefits to vision is less clear to me.

While there is always a market for the absolute best accuracy, in the real world the product with the most positive impact will be the one with the best balance in terms of speed/size/performance.

I think Elon Musk mentioned something similar regarding range in electric vehicles, longest isn't necessarily best when all factors are considered.

glenn-jocher avatar Jul 29 '22 12:07 glenn-jocher

Is there a model for yolov5s-transform ?

konioy avatar Aug 05 '22 08:08 konioy

@konioy https://github.com/ultralytics/yolov5/blob/master/models/hub/yolov5s-transformer.yaml

glenn-jocher avatar Aug 05 '22 15:08 glenn-jocher

what is the architecture of transformer with yolov5. is this used in backbone in topup with existing backbone or replacing with transformer, or in detection head. Can you make a bit clear.

ratom avatar Aug 08 '22 04:08 ratom

@ratom you can just do a diff between yolov5s-transformer.yaml above and yolov5s.yaml

glenn-jocher avatar Aug 08 '22 15:08 glenn-jocher

Is there a pretrained model for yolov5s-transformer?

konioy avatar Aug 15 '22 03:08 konioy

@konioy no, sorry. You can train one on COCO yourself though:

python train.py --weights yolov5s.pt --cfg yolov5s-transformer.yaml --data coco.yaml

glenn-jocher avatar Aug 17 '22 22:08 glenn-jocher

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

  • Wiki – https://github.com/ultralytics/yolov5/wiki
  • Tutorials – https://docs.ultralytics.com/yolov5
  • 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 YOLOv5 🚀 and Vision AI ⭐!

github-actions[bot] avatar Sep 17 '22 00:09 github-actions[bot]