bilylee / SiamFC-TensorFlow

A TensorFlow implementation of the SiamFC tracker
MIT License
358 stars 112 forks source link

get_crops question #103

Open takeandrei5 opened 4 years ago

takeandrei5 commented 4 years ago

Hello, I was going through your code and I saw a couple of differences between def get_crops(im, bbox, size_z, size_x, context_amount): and function [im_crop_z, bbox_z, pad_z, im_crop_x, bbox_x, pad_x] = get_crops(im, object, size_z, size_x, context_amount) from bertinetto/siamese-fc/save_crops.

The ones that I am interested are these:

[im_crop_x, left_pad_x, top_pad_x, right_pad_x, bottom_pad_x] = get_subwindow_avg(im, [cy cx], [size_x size_x], [round(s_x) round(s_x)]); pad_x = ceil([scale_x*(left_pad_x+1) scale_x*(top_pad_x+1) size_x-scale_x*(right_pad_x+left_pad_x) size_x-scale_x*(top_pad_x+bottom_pad_x+1)]); ws_z = w * scale_z; hs_z = h * scale_z; ws_x = w * scale_x; hs_x = h * scale_x; bbox_z = [(size_z-ws_z)/2, (size_z-hs_z)/2, ws_z, hs_z]; bbox_x = [(size_x-ws_x)/2, (size_x-hs_x)/2, ws_x, hs_x];

Could you explain why?

bilylee commented 4 years ago

These variables are computed in the Matlab version. However, since they are not used in the actual tracking process, they are removed for speed in this repository.