| | |
| | | from auto_media_publisher.utils.face_swap.face_swaper_ffmpeg import FaceSwapWorker |
| | | from auto_media_publisher.utils.face_swap.face_swaper_ffmpeg_stream import FFmpegVideoProcessor |
| | | from auto_media_publisher.modifiers.face_swap.face_swapper_enhancer import FaceSwapperEnhancer |
| | | import time |
| | | |
| | | import os |
| | | import warnings |
| | | warnings.filterwarnings("ignore") |
| | | |
| | |
| | | |
| | | |
| | | |
| | | processor2 = FFmpegVideoProcessor(enable_enhancer=True,enable_nsfw_predictor=False) |
| | | processor = FaceSwapperEnhancer() |
| | | |
| | | start_time = time.time() |
| | | |
| | | processor2.run("./temp/lilizhen.jpg","./temp/buhui.mp4", "./temp/buhui-lilizhen-with-enhancer.mp4", num_workers=4) |
| | | |
| | | #worker.swap_face('./temp/lilizhen.jpg', './temp/g1.mp4', './temp/g1_no_enhancer.mp4',1) |
| | | processor.swap("./temp/buhui.mp4", "./temp/buhui-lilizhen-with-new.mp4","./temp/lilizhen.jpg") |
| | | |
| | | print(time.time()-start_time) |
| | | |