SamsungLabs / fbrs_interactive_segmentation

[CVPR2020] f-BRS: Rethinking Backpropagating Refinement for Interactive Segmentation https://arxiv.org/abs/2001.10331

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the meaning of check_possible_recalculation function in zoom_in.py?

lfxx opened this issue · comments

Why we need this function?

This function is used only if skip_clicks is 0. In that case, Zoom-In applies even for the very first click. Actually, we don't have any information about an object location in an image before the first clicks, so we can't straightforwardly apply Zoom-In to the first click. However, we can retrieve an object location by running network with disabled Zoom-In and then rerun our model with Zoom-In initialized with the object location for the very first click.

This function is used here: https://github.com/saic-vul/fbrs_interactive_segmentation/blob/e036ce05976e026376f1551c2846925ac585be3d/isegm/inference/predictors/base.py#L49

And it checks whether we need to rerun model for the first click. So, to sum up, in some cases our model can do 2 forward passes for the first click when Zoom-In is activated and skip_clicks is 0.

This function is used only if skip_clicks is 0. In that case, Zoom-In applies even for the very first click. Actually, we don't have any information about an object location in an image before the first clicks, so we can't straightforwardly apply Zoom-In to the first click. However, we can retrieve an object location by running network with disabled Zoom-In and then rerun our model with Zoom-In initialized with the object location for the very first click.

This function is used here:

https://github.com/saic-vul/fbrs_interactive_segmentation/blob/e036ce05976e026376f1551c2846925ac585be3d/isegm/inference/predictors/base.py#L49

And it checks whether we need to rerun model for the first click. So, to sum up, in some cases our model can do 2 forward passes for the first click when Zoom-In is activated and skip_clicks is 0.

Understand it,thank you