SHI-Labs / OneFormer

OneFormer: One Transformer to Rule Universal Image Segmentation, arxiv 2022 / CVPR 2023
https://praeclarumjj3.github.io/oneformer
MIT License
1.41k stars 128 forks source link

Retrain one class using a custom dataset #49

Open dokunima opened 1 year ago

dokunima commented 1 year ago

Is there a guide/suggestion on how to retrain one class using a custom dataset and also rename the class? Assuming one of the classes trained using Swin-L is tree. Can I retrain the class with a dataset of almond trees and rename the class to almond?

Thank you. @honghuis @rbavery @SkalskiP @praeclarumjj3 @alihassanijr

praeclarumjj3 commented 1 year ago

Hi @dokunima, thanks for your interest in our work. If I understand you correctly, do you want to fine-tune a Swin-L OneFormer on a dataset with a single class? You can easily register a new custom dataset with whatever name you want.

dokunima commented 1 year ago

Hi @praeclarumjj3 ,

I like your work. Thanks for your reply. Let's say I upload a photo of an almond tree to Hugging Face/Colab and I select the COCO model using Swin-L as the backbone and the panoptic/semantic segmentation result tells me that it is a tree (which is correct). I am asking for guidance/suggestions on how to fine-tune the tree class with a small dataset consisting of 80 photos of almond trees. Coco Annotator was used to label the dataset and I have one .json file containing the annotation.

How can I log the training & validation losses and AP? Is it possible to implement early stopping callback?