facebookresearch / unbiased-teacher

PyTorch code for ICLR 2021 paper Unbiased Teacher for Semi-Supervised Object Detection
https://arxiv.org/abs/2102.09480
MIT License
410 stars 82 forks source link

Experiment on custom dataset #8

Closed A1exy closed 3 years ago

A1exy commented 3 years ago

Hi, sir. Thanks for your excellent idea! Now I want to experiment on a custom coco format dataset,but I don't know how to generate dataseed/COCO_supervision.txt. Can you give me some Suggestions?

ycliu93 commented 3 years ago

Hi @A1exy,

The reason why we create the COCO_supervision.txt is to make sure the results are reproducible. If you would like to apply to the custom dataset, you could change this line https://github.com/facebookresearch/unbiased-teacher/blob/05dad84c8e1bb44c6fd14706571ab0769143e48d/ubteacher/data/build.py#L44

to your sampled numpy array.

num_label = int(sup_p / 100. * num_all). labeled_idx = np.random.choice(range(num_all), size=num_label, replace=False) sup_p is labeled data ratio (e.g., 1 for 1%), and num_all is total number of images in your dataset.

And, don't forget to remove line 41 and 42. :)

Thanks!