-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.sh
executable file
·46 lines (35 loc) · 1.09 KB
/
setup.sh
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
#!/bin/bash
# Install FFMPEG
os=$(uname -a)
# Check if ffmpeg is installed
if ! command -v ffmpeg &> /dev/null
then
if [[ $os == *"arch"* ]]; then
# If the OS is Arch Linux, use pacman
sudo pacman -S ffmpeg
elif [[ $os == *"Ubuntu"* ]] || [[ $os == *"Debian"* ]]; then
# If the OS is Ubuntu or Debian, use apt-get. Also install python3-venv because it is not installed by default in debian.
sudo apt-get install ffmpeg
sudo apt install python3-venv
fi
fi
# Check if CUDA is installed
if [ -z "$CUDA_PATH" ]
then
echo "CUDA is not installed. Please install CUDA."
echo "CPU will be used for inference."
fi
# Create a virtual environment
python3 -m venv .lip-wise
wait
# Activate the virtual environment
source .lip-wise/bin/activate
wait
# Get Python version
python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
# Install requirements
pip install -r requirements.txt
# Copy archs
cp archs/* .lip-wise/lib/python${python_version}/site-packages/basicsr/archs/
# Run file_check.py
python ./helpers/file_check.py