-
Notifications
You must be signed in to change notification settings - Fork 155
Exemplar Framing
Framing exemplars is an important pre-processing step. The process of "framing" an exemplar is choosing a HOG feature size/location given an input image I and a ground-truth bounding box bb. In both framing strategies described below, the full HOG feature pyramid is computed, and a slice is selected from the pyramid. Each slice will have its own slice-bb, and I also maintain the "ground-truth" gt-bb. Let's say that during detection we got a HOG match at location detection-bb, I then estimate the transformation between slice-bb and detection-bb and apply that transformation to gt-bb to get a better localization of the bounding box.
By design, this means that running the Exemplar-SVM on the image which originated the exemplar will return a perfect detection. Since framing is done by choosing a slice from the pyramid, and detection uses the same exact pyramid, there are no border issues which can pop up if we manipulate the input image differently than computing a pyramid.
GoalNCells: initialize_goalsize_model.m
Finds a slice from the pyramid which overlaps with GT and has GoalNCells cells. Zero cells (from boundary of hog descriptor) are simply left out. There is no need for an explicit mask, since the size of the region is not fixed.
init_params.sbin = 8;
init_params.goal_ncells = 100;
init_params.init_function = @initialize_goalsize_model;
FixedSize: initialize_fixedframe_model.m
Outside-image cells: A mask is maintained which indicates which cells are within the image, and learning can only be performed over those cells. Experiments indicate that not doing this means that the exemplar will try to find matches with a zero in the same region.
init_params.sbin = 8;
init_params.hg_size = [8 8];
init_params.init_function = @initialize_fixedframe_model;
Please check out a demo of framing here: https://github.com/quantombone/exemplarsvm/raw/master/pdfs/demo_framing.pdf
I think by removing the zero cells, I made the detector much better...