Advertisement
Guest User

Drop_videos_here

a guest
Jul 6th, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.09 KB | None | 0 0
  1. @echo off
  2.  
  3. set "FACE_IMG="
  4. set "VIDEOS="
  5. set "OUTPUT_DIR=output\"
  6.  
  7. if "%~1"=="" (
  8.     echo Pass at least one video file!
  9.     pause
  10.     goto :eof
  11. )
  12.  
  13. echo Path to face image:
  14. set /p "FACE_IMG="
  15.  
  16. for %%i in ("%FACE_IMG%") do (
  17.     if "%%~xi"==".jpg" set "FACE_IMG=%%i"
  18.     if "%%~xi"==".jpeg" set "FACE_IMG=%%i"
  19.     if "%%~xi"==".png" set "FACE_IMG=%%i"
  20. )
  21.  
  22. if not defined FACE_IMG goto wrong_args
  23. echo Face image file is: %FACE_IMG%
  24. for %%i in ("%FACE_IMG%") do set "FACE_NAME=%%~ni"
  25.  
  26. call %userprofile%\anaconda3\Scripts\activate.bat %userprofile%\anaconda3
  27. cd %~dp0
  28. call activate simswap
  29. :swap_video
  30. echo Swapping video: %~nx1
  31. call python test_video_swapmutil.py --isTrain false --name people --Arc_path arcface_model/arcface_checkpoint.tar --temp_path ./temp_results ^
  32.         --pic_a_path %FACE_IMG% ^
  33.         --video_path %~1 ^
  34.         --output_path "./%OUTPUT_DIR%%FACE_NAME%_%~n1.mp4"
  35. )
  36. shift
  37. if not "%~1"=="" goto :swap_video
  38. if exist %~dp0%OUTPUT_DIR% call explorer /select,%~dp0%OUTPUT_DIR%
  39. goto :eof
  40.  
  41. :wrong_args
  42. echo No face image provided^!
  43. echo Args: %~1 %VIDEO%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement