ucbdrive / hd3

Code for Hierarchical Discrete Distribution Decomposition for Match Density Estimation (CVPR 2019)
BSD 3-Clause "New" or "Revised" License
204 stars 31 forks source link

How to visualize Confidence Map? #10

Closed kwea123 closed 5 years ago

kwea123 commented 5 years ago

Hi, I wonder how to visualize the Confidence Map like in the paper? I am using optical flow, and I suppose I should get it here: https://github.com/ucbdrive/hd3/blob/1b0185d5ed24148895dc6ae573a315ddb99f8a01/hd3model.py#L36-L37

but the result['prob'] is a tensor that has 81 channels...

Can you help me with this? Thanks.

kwea123 commented 5 years ago

found the answer. https://github.com/ucbdrive/hd3/blob/2874b6b5186d02b7499562af40fbd48d85798dba/utils/visualizer.py#L44-L48

amaanda commented 5 years ago

@kwea123 were you able to save the output confidence map?

kwea123 commented 5 years ago

Yes, just need to do that piece of code I found. It gives an array of shape (H,W).

kwea123 commented 5 years ago

I recoded this part by myself in jupyter notebook. The cells 199,200,182 are what you want.

amaanda commented 5 years ago

@kwea123 yes, in order to get that i tried get_prob=True and get_vis=True in https://github.com/ucbdrive/hd3/blob/1b0185d5ed24148895dc6ae573a315ddb99f8a01/hd3model.py#L23-L30

but i get the following error: gt_flo, valid_mask = downsample_flow(label_list[0] IndexError: list index out of range

amaanda commented 5 years ago

@kwea123 i will check that out then. thanks for sharing your solution!

kwea123 commented 5 years ago

I didn't use their code so I can't tell you why the error appears.. but I can guarantee my code, you just need to change the image paths.