Closed zhangyuygss closed 6 years ago
@zhangyuygss We plan to release more demo code later; we are too busy these days.
@yeezhu For the bounding box, does the following match your box generation procedure?
def deduce_tightest_box_from_class_specific_convolutional_map(conv_map, image_height, image_width):
binary_map = conv_map > conv_map.mean()
IJ = binary_map.nonzero()
# x1, y1, x2, y2
return (float(image_width) * IJ[:, 1].min() / conv_map.size(1), \
float(image_height) * IJ[:, 0].min() / conv_map.size(0), \
float(image_width) * IJ[:, 1].max() / conv_map.size(1), \
float(image_height) * IJ[:, 0].max() / conv_map.size(0))
Are you doing any filtering of the binary_map
to remove spurious spikes?
Thanks!
especially with the CVPR deadline approaching :)
@vadimkantorov Sorry for the delay. The code snippet seems fine, but we resize the map to raw image size first.
@yeezhu Thanks for getting back on this!
For generating the class-specific score map in test time, is the snippet below accurate? (it seems so from equation R_c = \sum_k w_{k,c} * U_k \cdot M
in the paper, except the equation doesn't consider the bias term)
class SPNetWSL(nn.Module):
# ....
def generate_class_specific_score_maps(self, x, use_soft_proposals = True):
x = self.features(x)
x = self.spatial_pooling.adconv(x)
x = self.spatial_pooling.maps(x)
if use_soft_proposals:
x = self.spatial_pooling.sp(x)
x = self.classifier(x.unsqueeze(-1).transpose(-4, -1)).transpose(-4, -1).squeeze(-1)
return x
Thanks :)
@vadimkantorov Yes, the bias term is not considered.
@zhangyuygss The demo was released. If you have other questions, please email me :)
I modified the model definition code to extract the proposal map and the output feature of SP layer for bounding box generating, but not sure if I was doing it right. So could you please release code for that part?