Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error rendering potsdam label #85

Closed
qAp opened this issue Aug 31, 2020 · 2 comments
Closed

Error rendering potsdam label #85

qAp opened this issue Aug 31, 2020 · 2 comments

Comments

@qAp
Copy link

qAp commented Aug 31, 2020

Hi
When RENDER_DATA is set to True in potsdam.py, an AssertionError arising from the data having a wrong shape is returned:

~/git_repos/IIC/IIC/datasets/segmentation/potsdam.py in _prepare_test(self, index, img, label)
    336 
    337     if RENDER_DATA:
--> 338       render(label, mode="label", name=("test_data_label_pre_%d" % index))
    339 
    340     # convert to coarse if required, reindex to [0, gt_k -1], and get mask

~/git_repos/IIC/IIC/utils/segmentation/render.py in render(data, mode, name, colour_map, offset, out_dir)
     23       return
     24     else:
---> 25       assert (len(data.shape) == 3)
     26   else:
     27     assert (mode == "mask" or mode == "matrix" or mode == "preds")

AssertionError: 

Loading a potsdam example's ground truth mat file this way:

assert label_path.exists()
label = sio.loadmat(label_path)['gt']
assert label.dtype==np.int32
label.shape

returns an array, label, with shape (200, 200), which has length 2.

@xu-ji
Copy link
Owner

xu-ji commented Sep 4, 2020

I recommend writing your own code to render the data. I think that flag is quite old and possibly unsupported.

See my reply here.

@qAp
Copy link
Author

qAp commented Sep 11, 2020

k thanks

@qAp qAp closed this as completed Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants