Wizaron / instance-segmentation-pytorch

Semantic Instance Segmentation with a Discriminative Loss Function in PyTorch
https://arxiv.org/abs/1708.02551
GNU General Public License v3.0
458 stars 95 forks source link

cityscapes annotations problem #8

Open jxlijunhao opened 6 years ago

jxlijunhao commented 6 years ago

Hi, I'm not understand why you set all instance id to 1,
cleaned_db_instance_annotation = np.stack(cleaned_db_instance_annotation, axis=2) instance_annotation = cleaned_db_instance_annotation.copy() instance_annotation[instance_annotation != 0] = 1

Wizaron commented 6 years ago

Hey,

instance_annotation is a numpy array of shape (image_height, image_width, number_of_instances) and stores instance annotations as a one-hot vector at each channel. semantic_annotation is a numpy array of shape (image_height, image_width) and stores semantic class indexes.

cleaned_db_instance_annotation at line 149 is a numpy array of shape (image_height, image_width, number_of_instances) and each channel stores instance annotations with their semantic class index.

Therefore, I converted cleaned_db_instance_annotation to one-hot instance_annotation at line 153.

Also, I did not experiment with cityscapes dataset yet. There may be bugs in dataset creation procedure.

Thanks.