facebookresearch / DetectAndTrack

The implementation of an algorithm presented in the CVPR18 paper: "Detect-and-Track: Efficient Pose Estimation in Videos"
Apache License 2.0
1k stars 186 forks source link

How To Question: Change Background to Black #47

Closed kaisark closed 6 years ago

kaisark commented 6 years ago

I tested with the test_on_single_video.py script and everything is working, but I wanted to know what is the quickest way to change the background to black so that only the keypoints are seen? Does vis.py (vis_one_image_opencv) need to be modified?

Example below is with openpose...

Thanks.

openopose gif-downsized_large

kaisark commented 6 years ago

I found a solution. I added a line of code to _vis_single_frame in the test_on_single_video.py script.

def _vis_single_frame(im, cls_boxes_i, cls_segms_i, cls_keyps_i, cls_tracks_i, thresh): im = np.zeros(im.shape) #kkhatak - line of code added to make background black ### res = vis_utils.vis_one_image_opencv( im, cls_boxes_i, segms=cls_segms_i, keypoints=cls_keyps_i, tracks=cls_tracks_i, thresh=thresh, show_box=False, show_class=False, linewidth = 6) if res is None: return im return res

dtrack2-computervision gif-downsized_large

walker-dt1