protossw512 / AdaptiveWingLoss

[ICCV 2019] Adaptive Wing Loss for Robust Face Alignment via Heatmap Regression - Official Implementation
Apache License 2.0
395 stars 88 forks source link

How to show boundary map #11

Closed a462428 closed 4 years ago

a462428 commented 4 years ago

Hi, really thx for you excellent contribution. I wonder how to show boundary map in your code (boundary_channels) like the boundary heat map show in your paper

Thanks!

protossw512 commented 4 years ago

If you look at the heatmap prediction output, you will find it has N+1 channels where N is the number of landmarks. The last channel is the boundary map you need. Then you may apply a colormap to get the desired visualization in my paper.

a462428 commented 4 years ago

Thx! However, the response of boundary heatmap is very low. Is that normal?

Heat_bound = outputs[-1][:,-1,:,:].detach().cpu().numpy() Boundary = Heat_bound[0] Boundary = np.uint8(Boundary) Boundary = cv2.applyColorMap(boundary, cv2.COLORMAP_RAINBOW)

protossw512 commented 4 years ago

@a462428 The values of boundary map are floating numbers from 0 to 1, so you have to multiply them by 255 before converting to uint8.

Boundary = np.uint8(Boundary * 255)

Hope that helps