@echo off

echo WARNING. For this auto installer to work you need to have installed Python 3.10.x, Git, Cuda 11.8, FFmpeg and C++ tools 
echo Follow this tutorial step by step to install above requirements : https://youtu.be/-NjNy7afOQ0

pip install requests

git clone https://github.com/SECourses/LivePortrait

cd LivePortrait

py --version >nul 2>&1
if "%ERRORLEVEL%" == "0" (
    echo Python launcher is available. Generating Python 3.10 VENV
    py -3.10 -m venv venv
) else (
    echo Python launcher is not available, generating VENV with default Python. Make sure that it is 3.10
    python -m venv venv
)

call .\venv\Scripts\activate.bat

echo installing requirements 

pip install -r requirements.txt

pip install https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp310-cp310-win_amd64.whl

pip install huggingface_hub

echo Downloading models from HF

python HF_model_downloader.py

cd src/utils/dependencies/XPose/models/UniPose/ops
python setup.py build install

REM Show completion message
echo Virtual environment made and installed properly

REM Pause to keep the command prompt open
pause