Advertisement
formulake

Install Insightface

Aug 19th, 2024
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.25 KB | Source Code | 0 0
  1. @echo off
  2. REM Define variables
  3. set "SCRIPT_DIR=%~dp0"
  4. set "INSIGHTFACE_WHEEL_URL=https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp312-cp312-win_amd64.whl"
  5. set "INSIGHTFACE_WHEEL_FILE=%SCRIPT_DIR%insightface-0.7.3-cp312-cp312-win_amd64.whl"
  6. set "INSWAPPER_URL=https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128.onnx"
  7. set "INSWAPPER_FILE=%SCRIPT_DIR%models\inswapper_128.onnx"
  8. set "MODELS_DIR=%SCRIPT_DIR%models\insightface"
  9.  
  10. REM Download insightface wheel file
  11. echo Downloading insightface wheel file...
  12. powershell -Command "Invoke-WebRequest -Uri %INSIGHTFACE_WHEEL_URL% -OutFile %INSIGHTFACE_WHEEL_FILE%"
  13.  
  14. REM Activate the virtual environment
  15. echo Activating virtual environment...
  16. call venv\Scripts\activate
  17.  
  18. REM Upgrade Pip
  19. echo Upgrading Pip...
  20. python -m pip install -U pip
  21.  
  22. REM Install insightface package
  23. echo Installing insightface...
  24. pip install %INSIGHTFACE_WHEEL_FILE%
  25.  
  26. REM Create models directory if it doesn't exist
  27. echo Creating models directory...
  28. mkdir "%MODELS_DIR%"
  29.  
  30. REM Download inswapper file and place it in the models directory
  31. echo Downloading inswapper model...
  32. powershell -Command "Invoke-WebRequest -Uri %INSWAPPER_URL% -OutFile %INSWAPPER_FILE%"
  33.  
  34. echo Done!
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement