|
#!/bin/bash |
|
eval "$(conda shell.bash hook)" |
|
|
|
|
|
env_exists=1 |
|
if [ ! -d ~/.conda/envs/SwapFace2Pon ] |
|
then |
|
env_exists=0 |
|
conda create -y -n SwapFace2Pon python=3.10 |
|
fi |
|
|
|
conda activate facefusion |
|
|
|
|
|
if [ ! -d "SwapFace2Pon" ] |
|
then |
|
git clone https://huggingface.co/spaces/victorisgeek/SwapFace2Pon |
|
fi |
|
|
|
|
|
|
|
if [ $# -eq 1 ] && [ $1 = "update" ] |
|
then |
|
cd SwapFace2Pon |
|
git pull |
|
cd .. |
|
fi |
|
|
|
|
|
if [ $# -eq 1 ] && [ $1 = "update" ] || [ $env_exists = 0 ] |
|
then |
|
cd SwapFace2Pon |
|
python install.py --torch cuda --onnxruntime cuda |
|
cd .. |
|
pip install pyngrok |
|
conda install opencv -y |
|
conda install ffmpeg |
|
fi |
|
|
|
|
|
if [ $# -eq 0 ] |
|
then |
|
python start-ngrok.py |
|
elif [ $1 = "reset" ] |
|
then |
|
python start-ngrok.py --reset |
|
fi |
|
|