MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
7.83k stars 1.96k forks source link

How to remove the background from alphapose video #1078

Open kokwai48699 opened 1 year ago

kokwai48699 commented 1 year ago

Is there a way to remove the background from the video after processed like the one in openpose with --disable_blending?

StonePanda commented 1 year ago

hello, have you found the way to remove backgound?

StonePanda commented 1 year ago

Hello, I have read the code and found that just change the argument which is fed into writer.save() function. For the details, change the Line 260 of demo_inference.py from this:

writer.save(boxes, scores, ids, hm, cropped_boxes, orig_img, im_name)

to this:

black_img=np.zeros((180,320,3))
writer.save(boxes, scores, ids, hm, cropped_boxes, black_img, im_name)

Then, you will see the black ground with skeleton rendered in the output images.

fz5400 commented 1 year ago

Hello, I have read the code and found that just change the argument which is fed into writer.save() function. For the details, change the Line 260 of demo_inference.py from this:

writer.save(boxes, scores, ids, hm, cropped_boxes, orig_img, im_name)

to this:

black_img=np.zeros((180,320,3))
writer.save(boxes, scores, ids, hm, cropped_boxes, black_img, im_name)

Then, you will see the black ground with skeleton rendered in the output images.

Thanks for the codes, This will automatically adjust the size of the background image

black_img=np.zeros(orig_img.shape)