File size: 988 Bytes
a52ca62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
eval "$(conda shell.bash hook)"

# Create the Conda environment
env_exists=1
if [ ! -d ~/.conda/envs/SwapFace2Pon ]
then
  env_exists=0
  conda create -y -n SwapFace2Pon python=3.10
fi 

conda activate facefusion

# Get SwapFace2Pon from GitHub
if [ ! -d "SwapFace2Pon" ]
then
  git clone https://huggingface.co/spaces/victorisgeek/SwapFace2Pon
fi

# Update the installation if the parameter "update" was passed by running
# start.sh update
if [ $# -eq 1 ] && [ $1 = "update" ]
then
  cd SwapFace2Pon
  git pull
  cd ..
fi

# Install the required packages if the environment needs to be freshly installed or updated 
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

# Start SwapFace2Pon with ngrok
if [ $# -eq 0 ]
then
  python start-ngrok.py 
elif [ $1 = "reset" ]
then
  python start-ngrok.py --reset 
fi