-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
33 lines (25 loc) · 1.06 KB
/
setup.sh
File metadata and controls
33 lines (25 loc) · 1.06 KB
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
#!/usr/bin/env bash
# MAKE SCRIPT EXECUTABLE
chmod +x background-remover.py
# INSTALL DEPENDENCIES
python3 -m venv gimpenv
source gimpenv/bin/activate
python3 -m pip install numpy
python3 -m pip install pillow
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
#python3 -m pip install torchvision
python3 -m pip install opencv-python
deactivate
wget -O Ldf/model-40 https://huggingface.co/ManuelVogel12/LDF_weights/resolve/main/model-40
# CHECK IF THE FOLDER NAMES ARE CORRECT
SCRIPT_PATH="$(realpath "$0")"
# Get the parent and grandparent folder names
PARENT_DIR=$(basename "$(dirname "$SCRIPT_PATH")")
GRANDPARENT_DIR=$(basename "$(dirname "$(dirname "$SCRIPT_PATH")")")
# Check if the folder names match
if [[ "$PARENT_DIR" != "background-remover" ]]; then
echo "CHECK YOUR PATHS: THE .PY FILE SHOULD BE PLACED IN A FOLDER OF THE SAME NAME, e.g. 'background-remover.py' inside 'background-remover'."
fi
if [[ "$GRANDPARENT_DIR" != "plug-ins" ]]; then
echo "THE GRANDPARENT FOLDER OF THE SCRIPT SHOULD BE 'plug-ins'. FOUND: $GRANDPARENT_DIR"
fi