WongKinYiu / YOLO

An MIT rewrite of YOLOv9
MIT License
478 stars 50 forks source link

Classify task? #82

Open tjasmin111 opened 3 weeks ago

tjasmin111 commented 3 weeks ago

Is there a plan to add a classify task, just like original YOLO? I use both classify and detect task from the original yolov8 and would like to replace both with your repo.

Abdul-Mukit commented 3 weeks ago

I believe classification is one of the TODO tasks in this repo. Please check the landing readme page.

The original YOLO is YOLO1. Everything else including this repo are derivative works IMO. As far as I have read YOLOv5 is just a modified version of YOLO4. YOLOv8 is just a modified version of YOLOv9. I think this cycle will just keep continuing.

Here are some helpful links that I learned from. A review paper that reviews the different architectures v1 upto 2023. We can see that YOLOv5 and YOLOv8 didn't even have a paper. https://arxiv.org/abs/2304.00501

Here is a good article from OpenCV that shows us different options and licenses. Old doc. https://www.opencv.ai/blog/yolo-unraveled-a-clear-guide

Finally, a Redit post that talks about the APGL and how anything one outputs using APGL (weights, or anything else), has to be open-souced unless the Enterprise license is purchased. https://www.reddit.com/r/computervision/comments/1e3uxro/ultralytics_new_agpl30_license_exploiting/

Abdul-Mukit commented 3 weeks ago

You can consider starting the classify task? Maybe make a PR? Shouldn't be very different. One just needs to reuse the backbone. Delete neck + head. Add a classification head after backbone. Then do transfer learning using ImageNet dataset. All earlier yolo models yolo1-yolo4 had to pre-trained on classification tasks I believe before they started adding neck and detection heads.

tjasmin111 commented 3 weeks ago

I really like for it to have a classification task. But I think would be a bit hard for me to start the PR. Not very expert. For reference, can you specify the part of code we need to change for classification?

Abdul-Mukit commented 3 weeks ago

https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html You can look at these tutorials to familiarize yourself with the overall process.

henrytsui000 commented 3 weeks ago

Hi,

I just added a classification head in commit d44dbc0. However, I haven't added the loss function, pretrained weight, or training schedule yet. For the dataset, I'll enable the dataloader to load Torchvision's CIFAR100 as a baseline. Also, check if the memory leak issue occurs with Torchvision's dataloader as well.

Best regards,
Henry Tsui

tjasmin111 commented 3 weeks ago

Good progress. I'll check it out. So it can be used to train from scratch not using a pre trained weight right?