sacmehta / ESPNet

ESPNet: Efficient Spatial Pyramid of Dilated Convolutions for Semantic Segmentation
https://sacmehta.github.io/ESPNet/
MIT License
538 stars 111 forks source link

How to convert the label images to trainIDs using the cityscape scripts. #42

Closed MrLinNing closed 5 years ago

MrLinNing commented 5 years ago

Hello, @sacmehta

I'm new learner in semantic segmentation. My dataset structure is: image image

Problem happened, when i run python main.py in the train folder.

Label Image ID: 
...
/home/ll/DATA/cityscapes/gtFine/train/zurich/zurich_000032_000019_gtFine_labelTrainIds.png
Labels can take value between 0 and number of classes.
Some problem with labels. Please check.
...

Can you help me? Thanks.

sacmehta commented 5 years ago

You need to create ground truth masks with trainIds first. Follow this file for conversion:

https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/preparation/createTrainIdLabelImgs.py

MrLinNing commented 5 years ago

Can you give me more details? I don't know how to operate it. I think the ground truth masks with trainIds already created. image

TianMingChen commented 5 years ago

Can you give me more details? I don't know how to operate it. I think the ground truth masks with trainIds already created. image

hello,how do you to solve this problem?

ccyy commented 9 months ago

Hi, by using the below code, I could get color. png, how can I get labelids.png instead? Shall I convert it, or just edit the below code? https://www.kaggle.com/code/joechen02/pspnet-demo/comments Thank you

abheek19 commented 5 months ago

@sacmehta I have the images and labeled_images in png format. How do i convert the label images to trainIDs using cityscape scripts. I went to use the script but i could not get it working.