py-faster-rcnn network detection runs on CPU through ROS callback function
Hi there,
I'm trying to test my trained py-faster-rcnn network for object detection through ROS. I have a node running with many similarities to demo.py. Included in the class are commands to execute the network detection on the GPU (given below), however, looking at recall times (~26s) and the system profiler it's fairly clear that the network is running on the CPU. Is there a way to get around this?
caffe.set_mode_gpu()
caffe.set_device(0)
cfg.GPU_ID = 0
Interestingly, if I run demo.py normally (not through ROS), it executes on the GPU in ~2s
UPDATE: after some more detective work, it appears that it is an issue with calling CNN detection within a callback function. Any suggestions? (Other people seem to be experiencing a similar problem - Callback with GPU processing)
Thanks, Will
I don't know anything about caffe, but I do know that rospy runs callbacks in a separate thread from the main loop. Perhaps that helps?