Advertisement
Guest User

Drop_Pictures_Here

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