AliaksandrSiarohin / motion-cosegmentation

Reference code for "Motion-supervised Co-Part Segmentation" paper
Other
652 stars 142 forks source link

Swapping between two images. #17

Open AIdeveloper-oz opened 4 years ago

AIdeveloper-oz commented 4 years ago

Hi, I am a great fan for this kinda works and my appreciations to you. On analyzing the code, I get to know that, you swap face from an image to the face in a video feed. I have seen image to image face swapping using 68/81 facial keypoints. The results of your work seem to be better than keypoint based method. Is there any implementation of segmentation based swapping between images? Help, if you could. Thanks.

AliaksandrSiarohin commented 4 years ago

What do you mean a segmentation based swapping? This work uses segmentation.

AIdeveloper-oz commented 4 years ago

Yeah, I am aware of that. I referred Segmentation based swapping to your work only. I found you are doing it between videos, where frames are played with. I simply wanted to try this between two images. (src image, target image -> segmentation->copy the src mask on target image). Maybe this is simple and I am a new bee. Help, if you could. Thanks.

AliaksandrSiarohin commented 4 years ago

You can just use a single frame video, this will be effectively an image base swap.

instant-high commented 3 years ago

You can also use a .gif as target_video (instead of .mp4) and as result_video use also *.gif

Then you have to change the following lines in part_swap.py

(241) fps = reader.get_meta_data()['fps'] --> #fps = reader.get_meta_data()['fps']

(244) imageio.mimsave(opt.result_video, [img_as_ubyte(frame) for frame in predictions], fps=fps, bitrate=bitrate) -->imageio.mimsave(opt.result_video, [img_as_ubyte(frame) for frame in predictions])