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

I got a strange mask? #92

Open
mohhao opened this issue Jul 12, 2019 · 1 comment
Open

I got a strange mask? #92

mohhao opened this issue Jul 12, 2019 · 1 comment

Comments

@mohhao
Copy link

mohhao commented Jul 12, 2019

my image:
test
result:
mask
I use the code like this:

d = dcrf.DenseCRF2D(640, 368, 4)
prediction1 = prediction1.reshape((4, -1))
d.setUnaryEnergy(prediction1.astype(np.float32))
d.addPairwiseGaussian(sxy=3, compat=3)
cv2.imwrite('test.jpg', (image[i]/.016 + 128).astype(np.uint8))
d.addPairwiseBilateral(sxy=(80, 80), srgb=(13, 13, 13), rgbim=(image[i]/.016+128).astype(np.uint8),compat=10)
prediction1 = d.inference(5)
prediction1 = np.argmax(prediction1, axis=0)
prediction1 = np.reshape(prediction1, (368, 640))
predictio = np.stack((y_type1,y_type2,y_type3), axis=2)
cv2.imwrite('mask.jpg', (prediction1*255).astype(np.uint8))
@eduardathome
Copy link

Did you ever figure it out?

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