Open nikolaydyankov opened 1 year ago
I've uploaded a notebook to fine-tune OneFormer here: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/OneFormer/Fine_tune_OneFormer_for_semantic_segmentation.ipynb. Hope it helps!
Same issue, there are no tutorials that I can find in google of how to actually load an instance segmentation COCO dataset into the format HF expects for Mask2Former or OneFormer. As if no one uses COCO format with HF.
@nikolaydyankov have you managed to make it work?
I've uploaded a notebook to fine-tune OneFormer here: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/OneFormer/Fine_tune_OneFormer_for_semantic_segmentation.ipynb. Hope it helps!
Unfortunately the tutorial is about semantic segmentation (with a single mask as ground truth) and not for instance segmentation (where every image has a list of polygon coordinates).
It is unclear how to convert COCO instance segmentation to HuggingFace format to train either Mask2Former or Oneformer.
Hi I would really appreciate help on this as well. It is unclear how to train this model on custom datasets
I'm trying to fine-tune the model for instance segmentation with a custom dataset that I have locally in COCO format. The issue that I'm having is that I don't know how exactly to convert the segmentation polygon masks to pixel_values and task_inputs that the model's forward function expects.
This is my data loader script:
I know that I'm supposed to use
OneFormerProcessor
, but the examples provided are only for inference and don't specify how to process input masks. What exactly am I supposed to do in the_generate_examples
method? Any tips are greatly appreciated!Just for reference, here is my train script as well:
And this is the output: