Repository navigation
Home
This page contains explanation how the code should be run to reproduce results in the paper.
In preprocessing/Background Subtraction/sparse velocity run main.m. You might need to update folders containing sparse energy and frames from the videos.
- detect head in each of the first 10 frames. Number of detections per frames can be bigger than 1.
- filter detections
- track each detection using TLD famework.
- assign to each detection it's own weight and a label, if tracked detection coincide with the current one merge their label and add 1 to their weight.
- best trajectory is chosen as the one having the highest weight.
- track the best trajectory until the beginning and until the end to get full trajectory.
All files are in the folder:
cd /home/ibogun2010/Code/interaction-recognition/preprocessing/head detection/face-release1.0-basic
This detects heads (step 1)
detectFaces.m. This should return a cell array headDetectedTrajectories.
Filtering and further post-processing are in the directory cd /home/ibogun2010/Code/OpenTLD/TrackingHeads. Run filterDetectionsWhichOvelapTooMuch.m to delete static detections and the ones which are below the torso point ( script uses output from the previous step, for convenience the data is saved in headDetectionsAllLowThreshold.mat file). Result is the cell array filteredAllDetections . This finishes step 2.
Run main.m to finish steps 3 and 4. This will give indices of the 'good' detections. Using good detections
we can initialize the tracker and track it both directions. trackingProcessedDetections.m is doing just that, it takes detections using output of the main.m ( detections[good indices] ) and tracks it both direction.
Some trajectories might contain NaN, so we post-process them using postProcessTrajectories.m to get clean trajectories.
In the folder preprocessing run prepareDifferentSizeDataCalculatedTrajectories.m. Head trajectories cell array should be used here for normalization.
-
main.mto get location of a sparse energy larger than a threshold on the lowest position. -
prepareLocalizedPairs.mwill extract big patches around the object before and during interaction. -
calculateImageDifferences.mwill calculate differences between images with and without the object ( for better repositioning) -
finalizeLocalizations.mwill extract small bounding box around objects in the first 10 frames with better centering.
Once objects are localized cd /Interaction_appearance/ and run pLSA_CrossValidationRunsForBestNumberOfClusters.m. Unfortunately the code is written so that the objects will be reordered as (flashlight,cup,...,phone), so they will need to be reordered back to the ordering. Also, this scripts takes a lot of time to execute.
cd experiments/MKSVM and run . (code at home -> push it and finish this page)