Deci-AI / super-gradients

Easily train or fine-tune SOTA computer vision models with one open source training library. The home of Yolo-NAS.
https://www.supergradients.com
Apache License 2.0
4.54k stars 495 forks source link

Detecting 2d icons #962

Closed andrewvarga closed 1 year ago

andrewvarga commented 1 year ago

Hi! I'm wondering if I can use supergradients to detect 2d icons / symbols on images that are 2d, either scanned and can contain known or custom icons.

If there's any resources to read upon this it would be useful. Thank you.

dagshub[bot] commented 1 year ago

Join the discussion on DagsHub!

BloodAxe commented 1 year ago

Hi. Yes it is possible, yet you would have to have some proficiency with python in general and PyTorch in particular. Here I consider this task as classic object detection, since it's the most simple and would work for most cases. There are some more advanced options like one- or zero-shot object detection, but there are significantly harder to master.

The first step is to collect a dataset of icons you want to detect. The more - the better. Given the fact same icon can be scanned/printed/etc you want to collect as many variants as possible. There is not definition of done for this task. You always can improve the accuracy by collecting more data. Just at some point adding more data would give you diminishing returns. Let's just agree that 10 samples per icon is a bare minimum.

The second step is to annotate your icons. There are bunch of tools where you can do that. Take a look for CVAT or V7 labs for instance. Once you done with your dataset, it's time to export it. SuperGradients support COCO and Darknet formats for object detection task.

Third, you need to train the model for detecting your objects. A have a nice notebook showing how to fine-tune the existing model to your task: https://colab.research.google.com/drive/1q0RmeVRzLwRXW-h9dPFSOchwJkThUy6d This should be a good starting point to train your first model.

This is a very deep topic, so this answer for sure does not cover all details and nuances, but hopefully encourage you to go this route.