MehmetAygun / fusenet-pytorch

Other
81 stars 17 forks source link

Cannot open nyuv2_40class_mapping.mat file? #6

Closed gaoxiaoninghit closed 5 years ago

gaoxiaoninghit commented 5 years ago

the error is File "/usr/local/lib/python3.5/dist-packages/scipy/io/matlab/miobase.py", line 241, in get_matfile_version raise ValueError('Unknown mat file type, version %s, %s' % ret) ValueError: Unknown mat file type, version 105, 116? it seem that the mat file is cantain some illegal string or char,can you supply the mat with txt or other format。thank you very much

gaoxiaoninghit commented 5 years ago

this line :mapping = sio.loadmat("nyuv2/nyuv2_40class_mapping.mat")["mapping"][0]

MehmetAygun commented 5 years ago

Hi can you download file using a web browser, it seems that wget cannot properly download the file.

gaoxiaoninghit commented 5 years ago

Yes,I can download it,but use loadmat does not work ,I use some other mapping file to load(https://github.com/ankurhanda/nyuv2-meta-data),it works,thank you very much

hurricane2018 commented 5 years ago

Same Problem. How did you solve it? @gaoxiaoning @MehmetAygun

MehmetAygun commented 5 years ago

@hurricane2018 have you downloaded from this adres : https://github.com/tum-vision/fusenet/blob/master/fusenet/data/nyuv2_40class_mapping.mat

Because when you use wget it cannot download properly.

Also maybe it can be related to python version. I had no problem when I used python3.

hurricane2018 commented 5 years ago

@MehmetAygun Solved it. Thank you very much!

Scienceseb commented 5 years ago

Not working for me go the same error: Traceback (most recent call last): File "/media/seb/SSD2/fusenet-pytorch/datasets/create_training_set.py", line 74, in main() File "/media/seb/SSD2/fusenet-pytorch/datasets/create_training_set.py", line 71, in main create_dataset("nyu2") File "/media/seb/SSD2/fusenet-pytorch/datasets/create_training_set.py", line 66, in create_dataset create_nyu2() File "/media/seb/SSD2/fusenet-pytorch/datasets/create_training_set.py", line 16, in create_nyu2 mapping = sio.loadmat("nyuv2/nyuv2_40class_mapping.mat")["mapping"][0] File "/home/seb/anaconda3/envs/radar/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 207, in loadmat MR, file_opened = mat_reader_factory(file_name, appendmat, **kwargs) File "/home/seb/anaconda3/envs/radar/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 63, in mat_reader_factory mjv, mnv = get_matfile_version(byte_stream) File "/home/seb/anaconda3/envs/radar/lib/python3.6/site-packages/scipy/io/matlab/miobase.py", line 241, in get_matfile_version raise ValueError('Unknown mat file type, version %s, %s' % ret) ValueError: Unknown mat file type, version 105, 116

I use Python 3.7

MehmetAygun commented 5 years ago

@Scienceseb did you try above suggestions ? Downloading from web browser or from the link gaoxiaoning provided ?

Scienceseb commented 5 years ago

Thanks you your link work ! Why that error ???

Scienceseb commented 5 years ago

But when saving the labels in png everything is black, its working for the depth and rgb but not the labels (segmentation map)...need your help for that. I think Im messing up something maybe the scene ID and the class I dont know. I just want to obtain the segmentation map with the reduced number of class like in that repo https://github.com/zanilzanzan/FuseNet_PyTorch

MehmetAygun commented 5 years ago

Since labels between 0-number of class when it converted to rgb image, it represent a nearly a black image.

You can look the code for how to get a meaningful picture of labels.

Scienceseb commented 5 years ago

so you are saying that pixel value are between 0-40 on 255, ok but my image is pitch black no variation...I will tried your code tomorrow thank you, when I print it seem that most of the image is a pixel value of 0 also. There is sometime a pixel between 1-40

Scienceseb commented 5 years ago

And just to know you select 40 classes (the most common presumably) to do the segmentation and the other classes are all zero or not ?

sreshu commented 4 years ago

facing the same error for with 40 classes' one .mat file

hazirbas commented 4 years ago

Hi, @Scienceseb, that file is a mapping from X class to 40 classes. So for a pixel you can map to new class as: newI[x][y] = map40[I[x][y]]. And as Mehmet pointed out, you can colorize the image using a color palette.