alexppppp / synthetic-dataset-object-detection

How to Create Synthetic Dataset for Computer Vision (Object Detection) (Article on Medium)
https://medium.com/@alexppppp/how-to-create-synthetic-dataset-for-computer-vision-object-detection-fd8ab2fa5249
26 stars 8 forks source link

create synthetic dataset for Semantic Segmentation or instance segmentation #2

Open wrqf opened 2 years ago

wrqf commented 2 years ago

Dear authors,Very nice work! Thank you very much for your work. Could you please tell me how to create synthetic dataset for Semantic Segmentation or instance segmentation? Thank you so mush!

alexppppp commented 2 years ago

The composition of masks of the objects, which is generated during the script, can be used for instance segmentation. Just save the composition with masks into png-file. Also save classes of the objects on the composition into txt-file.

You can use the saved png- and txt-files for training an instance segmentation model using this tutorial: https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html

Example Lets suppose that the saved png-file contains pixels with values 0, 1, 2, 3, 4, 5. Pixels equal to 0 are related to background, pixels equal to other numbers are related to the objects. So, we have 5 objects on the image.

Lets suppose that the saved txt-file contains classes 2, 1, 1, 2, 2 (order matters!). It means that the object 1 is related to class 2, object 2 is related to class 1, object 3 is related to class 1, object 4 is related to class 2, object 5 is related to class 2.

Class 1 could be a cat, and class 2 could be a dog.

wrqf commented 2 years ago

Thank you very much for your guidance. I will try my best

itay-hilel commented 1 year ago

update for yolov7? add video?