e-lab / ENet-training

351 stars 88 forks source link

Save segmented labels #46

Closed ghost closed 7 years ago

ghost commented 7 years ago

Is there anyway to save the label result (saying just class number from 0-11 for 1-N) as an image file? It should be the tensor 'winners' from demo.lua in visualize. I could image.display(winners) but I couldn't image.save(winners) as it would save an image with all pixels at 255.

codeAC29 commented 7 years ago

@wzhouuu there might be better ways than this but what I use is, say you want to see the results for class/label i. You can use the following:

label_i = winners:eq(i)

This will give you a byte tensor (mask for class i). After this you can just save this mask as image file.

ghost commented 7 years ago

change the 'winners' type to float and 'winners/255' can be saved as image. solved the problem. Thanks!