NVlabs / mask-auto-labeler

Other
159 stars 14 forks source link

Customer dataset for coco format #6

Closed tianyufang1958 closed 1 year ago

tianyufang1958 commented 1 year ago

Hi again, I have a customer dataset with only one class called 'plant. Could you please kindly give me some advice how to modify the coco.py file? I did the following and python main.py can run, but I am not sure if it is correct.

import torch from torch.utils.data import Dataset from .voc import (InstSegVOC, BoxLabelVOC, BoxLabelVOCLMDB, InstSegVOCLMDB, InstSegVOCwithBoxInput)

import numpy as np

things = ["plant"] semistuff = ["plant"]

categories = [{'supercategory': 'plant', 'id': 1, 'name': 'plant'}]

cat_mapping = dict([ (cat['id'], idx+1) for idx, cat in enumerate(categories)])

training_config = { 'train_img_data_dir': 'data/coco/train', 'val_img_data_dir': 'data/coco/val', 'test_img_data_dir': 'data/coco/test', 'dataset_type': 'coco', 'train_ann_path': "data/coco/annotations/instances_train.json", 'val_ann_path': "data/coco/annotations/instances_val.json" }

generating_pseudo_label_config = { 'train_img_data_dir': 'data/coco/train', 'train_ann_path': "data/coco/annotations/instances_train.json", 'val_img_data_dir': 'data/coco/train', 'dataset_type': 'coco', 'val_ann_path': "data/coco/annotations/instances_train.json", }

voidrank commented 1 year ago
  1. You can delete anything related to things and semistuff.
  2. Others look good to me.