rafellerc / Pytorch-SiamFC

Pytorch implementation of "Fully-Convolutional Siamese Networks for Object Tracking"
Other
613 stars 148 forks source link

Possible Bug with ctx_size calculation in producer.py #13

Closed jackkwok closed 5 years ago

jackkwok commented 5 years ago

In producer.py, the docstring for make_ref() says:

ctx_mode: (str) The method used to define the context region around the target, options are ['max', 'mean'], where 'max' simply takes the largest of the two dimensions of the bounding box and mean takes the mean.

But in producer.py: if ctx_mode == 'max': ctx_size = max(bbox[2], bbox[3])

To match what I think the docstring is saying, I tried to changed ctx_size to the max of width and height: if ctx_mode == 'max': ctx_size = max(bbox[2] - bbox[0], bbox[3] - bbox[1])

But program crashes. Can you let me know if I am interpreting the docstring properly? Thanks.

jackkwok commented 5 years ago

My bad. The bbox is [xmin, ymin, width, height] format so the original code is correct.