Some changes to get this working with my object detection code.
NOTE: Not all of these changes are necessary.