HelloRicky123 / Siamese-RPN

Full reimplementation of siamese rpn, has 0.24 eao on vot2017.
MIT License
223 stars 44 forks source link

Shouldn't bbox be 0-based before passing to crop method in imagenet data generation? #44

Open amoudgl opened 5 years ago

amoudgl commented 5 years ago

https://github.com/HelloRicky123/Siamese-RPN/blob/8f0ec5459d11f5b8d0ee9cbbfbfc1a9bf8cd3505/bin/create_dataset_ytbid.py#L105-L112

Hey! thanks for sharing your work. In the above lines pointed out, I see that you transformed imagenet bbox (1-based [xmin, ymin, xmax, ymax]?) to center-based width height form ([cx, cy, w, h]). I think that the center-based bbox which you'll get will be 1-based:

 bbox = np.array( 
     [(bbox[2] + bbox[0]) / 2,   # <--- cx will be 1-based since xmin and xmax are 1-based?
      (bbox[3] + bbox[1]) / 2,
       bbox[2] - bbox[0] + 1, 
      bbox[3] - bbox[1] + 1]) 

I guess bbox above should be 0-based box before passing to get_instance_image method which expects a 0-based centered box:

 bbox = np.array( 
     [(bbox[2] + bbox[0]) / 2 - 1, 
      (bbox[3] + bbox[1]) / 2 - 1,
       bbox[2] - bbox[0] + 1, 
      bbox[3] - bbox[1] + 1]) 

Otherwise the generated crops will not have object exactly at the center, it would be off by 1. What do you think?