4 ms·
Random forests are great. I use them in real-time silhouette identification of people against backgrounds by porting the random forest to the GPU. This allows
by daenz 11y ago
Random forests are great. I use them in real-time silhouette identification of people against backgrounds by porting the random forest to the GPU. This allows blazing fast forest evaluation for every pixel of my input image concurrently. I used this paper to implement the design of it http://www.msr-waypoint.com/pubs/71445/ForestFire.pdf http://www.msr-waypoint.com/pubs/71445/ForestFire.pdf
The main trick is in storing the tree as a binary heap in the rows of a texture, with the left and right subtrees at 2i and 2i+1, respectively, and where the attribute index and split value are encoded in the color channels. Your texture width is your tree depth^2-1, and your texture height the number of trees in your forest. The texture ends up looking something like this (scaled up x10) http://i.imgur.com/afH5iFl.png http://i.imgur.com/afH5iFl.png
With a GPU shader, you can navigate these trees very quickly to classify an entire input image at once.