uber-research / DeepPruner

DeepPruner: Learning Efficient Stereo Matching via Differentiable PatchMatch (ICCV 2019)
Other
354 stars 41 forks source link

Some confusions about the definition of variables in patch_match #15

Closed FlyingGaifield closed 4 years ago

FlyingGaifield commented 4 years ago

Nice job! About reviewing your code about patch_match, I have some confusions about the definition and meaning of variables : filter_size=3, temperature=7 defined in function 'Evaluate' in patch_match.py.

Can you explain more about this two variables? THX

ShivamDuggal4 commented 4 years ago

Hi @FlyingGaifield glad that you liked our work.

Temperature is a softmax parameter, with T>>1 makes softmax closer to argmax. And filter_size is equal to the propagation_filter_size used during PatchMatch propagation.

In more detail, We divide the entire disparity search range into k bins, and then perform PatchMatch on each bin separately. Unlike original PatchMatch, the propagation step of our PatchMatch is convolution based and "propagation_filter_size" defines the size of the convolution filter used for propagation.

At the end of the propagation function, the disparities aggregated per pixel are reshaped as in line: https://github.com/uber-research/DeepPruner/blob/7cfd5e6845397683a98ea5a878f05e221c5dee79/deeppruner/models/patch_match.py#L200

Later the same filter_size is used for reshaping the (disparitysamples*) tensors back to allow the evaluation step to be performed on each bin separately.

I hope this helps, and for more details please refer to our paper. Thanks !!