-
Notifications
You must be signed in to change notification settings - Fork 86
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
Is there some question in transform.py? #18
Comments
Hey,
It is basically a python implementation of the Matlab class color function provided by the Pascal VOC project
https://gist.github.com/wllhf/a4533e0adebe57e3ed06d4b50c8419ae <https://gist.github.com/wllhf/a4533e0adebe57e3ed06d4b50c8419ae>
What it does is convert the labels (0, 1, …, 21 I think) to a more distinct RGB color code so that you can visualize how the network labeled objects.
… Am 06.04.2018 um 13:32 schrieb mshmoon ***@***.***>:
def colormap(n):
cmap=np.zeros([n, 3]).astype(np.uint8)
for i in np.arange(n):
r, g, b = np.zeros(3)
for j in np.arange(8):
r = r + (1<<(7-j))*((i&(1<<(3*j))) >> (3*j))
g = g + (1<<(7-j))*((i&(1<<(3*j+1))) >> (3*j+1))
b = b + (1<<(7-j))*((i&(1<<(3*j+2))) >> (3*j+2))
cmap[i,:] = np.array([r, g, b])
return cmap
I do not understand the function,please help me...
I use your main code to run a new network, but I can not decode a image from output
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#18>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABsq8u-TXv10gfRKrsDjp5amIwL2VIo_ks5tl1JhgaJpZM4TJ6IQ>.
|
Sorry,this code have a trouble
the mask is not a scalar,so it is not a index |
You can also index over |
index over np.array is not work ,beacause it appears other error,"TypeError: Performing basic indexing on a tensor and encountered an error indexing dim 0 with an object of type numpy.ndarray. "I don't know how to do ,can you answer me?Thank you |
def colormap(n):
cmap=np.zeros([n, 3]).astype(np.uint8)
I do not understand the function,please help me...
I use your main code to run a new network, but I can not decode a image from output
The text was updated successfully, but these errors were encountered: