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

Reading annotated images #4

Closed
kaulanishasj opened this issue May 31, 2017 · 1 comment
Closed

Reading annotated images #4

kaulanishasj opened this issue May 31, 2017 · 1 comment

Comments

@kaulanishasj
Copy link

Hi,
I just started exploring your codebase. I am trying to run segnet for my own project in which the images have fewer number of classes. When I try to just simply read one of the annotated images: '0001TP_006690.png' in the trainannot directory, I get this:

[[ 0.00392157 0.00392157 0.00392157 ..., 0.00392157 0.00392157
0.00392157]
[ 0.00392157 0.00392157 0.00392157 ..., 0.00392157 0.00392157
0.00392157]
[ 0.00392157 0.00392157 0.00392157 ..., 0.00392157 0.00392157
0.00392157]
...,
[ 0.01568628 0.01568628 0.01568628 ..., 0.04313726 0.04313726
0.04313726]
[ 0.01568628 0.01568628 0.01568628 ..., 0.04313726 0.04313726
0.04313726]
[ 0.01568628 0.01568628 0.01568628 ..., 0.04313726 0.04313726
0.04313726]]

The way I tried to read the png is by:
import matplotlib.image as img
image = img.imread('0001TP_006690.png')
print(image)

If i am not wrong, arent the classes supposed to be a whole number like 1,2..11(since there are 11 classes) instead of decimnal point numbers? or is there a conversion happening that I am not aware of.

@tkuanlun350
Copy link
Owner

I think matplotlib rescaled the data by itself. According to the document, "Matplotlib has rescaled the 8 bit data from each channel to floating point data between 0.0 and 1.0".(https://matplotlib.org/users/image_tutorial.html)

Maybe you can try to use my input reader in Inputs.py, it will use multi-thread and deocde png file by tensorflow library.

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