AlphaPose icon indicating copy to clipboard operation
AlphaPose copied to clipboard

How to remove the background from alphapose video

Open kokwai48699 opened this issue 2 years ago • 3 comments

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

kokwai48699 avatar Sep 11 '22 16:09 kokwai48699

hello, have you found the way to remove backgound?

StonePanda avatar Mar 26 '23 08:03 StonePanda

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.

StonePanda avatar Mar 26 '23 09:03 StonePanda

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)

fz5400 avatar Apr 13 '23 11:04 fz5400