xingxm commited on
Commit
b4daf24
·
1 Parent(s): 7fac471

fix(install): update install.sh

Browse files
Files changed (2) hide show
  1. README.md +2 -0
  2. script/install.sh +23 -12
README.md CHANGED
@@ -31,12 +31,14 @@ These instructions will help you run **quick inference locally**.
31
  Run the following command in the **top-level directory**:
32
 
33
  ```shell
 
34
  bash script/install.sh
35
  ```
36
 
37
  #### 🐳 Option 2: Using Docker
38
 
39
  ```shell
 
40
  sudo bash script/run_svgdreamer_docker.sh
41
  ```
42
 
 
31
  Run the following command in the **top-level directory**:
32
 
33
  ```shell
34
+ chmod +x script/install.sh
35
  bash script/install.sh
36
  ```
37
 
38
  #### 🐳 Option 2: Using Docker
39
 
40
  ```shell
41
+ chmod +x script/run_svgdreamer_docker.sh
42
  sudo bash script/run_svgdreamer_docker.sh
43
  ```
44
 
script/install.sh CHANGED
@@ -1,15 +1,23 @@
1
  #!/bin/bash
 
 
 
 
2
  eval "$(conda shell.bash hook)"
3
 
4
  conda create --name svgrender python=3.10 --yes
5
  conda activate svgrender
6
-
7
  echo "The conda environment was successfully created"
8
 
 
9
  conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch --yes
10
-
11
  echo "Pytorch installation is complete. version: 1.12.1"
12
 
 
 
 
 
 
13
  pip install hydra-core omegaconf
14
  pip install freetype-py shapely svgutils
15
  pip install opencv-python scikit-image matplotlib visdom wandb BeautifulSoup4
@@ -17,31 +25,34 @@ pip install triton numba
17
  pip install numpy scipy scikit-fmm einops timm fairscale==0.4.13
18
  pip install accelerate transformers safetensors datasets
19
  pip install easydict scikit-learn pytorch_lightning==2.1.0 webdataset
20
-
21
  echo "The basic dependency library is installed."
22
 
 
23
  pip install ftfy regex tqdm
24
  pip install git+https://github.com/openai/CLIP.git
25
-
26
  echo "CLIP installation is complete."
27
 
 
28
  pip install diffusers==0.20.2
29
-
30
  echo "Diffusers installation is complete. version: 0.20.2"
31
- # if xformers doesnt install properly with conda try installing with pip using the code below
32
- # pip install --pre -U xformers
33
- conda install xformers -c xformers --yes
34
-
35
- echo "xformers installation is complete."
36
 
 
37
  git clone https://github.com/BachiLi/diffvg.git
38
  cd diffvg
39
  git submodule update --init --recursive
 
 
 
 
 
 
40
  conda install -y -c anaconda cmake
41
  conda install -y -c conda-forge ffmpeg
42
  pip install svgwrite svgpathtools cssutils torch-tools
43
- python setup.py install
44
 
 
 
45
  echo "DiffVG installation is complete."
46
 
47
- echo "the running environment has been successfully installed!!!"
 
 
1
  #!/bin/bash
2
+
3
+ set -e
4
+
5
+ # Conda setup and environment creation
6
  eval "$(conda shell.bash hook)"
7
 
8
  conda create --name svgrender python=3.10 --yes
9
  conda activate svgrender
 
10
  echo "The conda environment was successfully created"
11
 
12
+ # Install PyTorch and related libraries
13
  conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch --yes
 
14
  echo "Pytorch installation is complete. version: 1.12.1"
15
 
16
+ # Install xformers
17
+ conda install xformers -c xformers --yes
18
+ echo "xformers installation is complete."
19
+
20
+ # Install common Python dependencies
21
  pip install hydra-core omegaconf
22
  pip install freetype-py shapely svgutils
23
  pip install opencv-python scikit-image matplotlib visdom wandb BeautifulSoup4
 
25
  pip install numpy scipy scikit-fmm einops timm fairscale==0.4.13
26
  pip install accelerate transformers safetensors datasets
27
  pip install easydict scikit-learn pytorch_lightning==2.1.0 webdataset
 
28
  echo "The basic dependency library is installed."
29
 
30
+ # Additional utility libraries
31
  pip install ftfy regex tqdm
32
  pip install git+https://github.com/openai/CLIP.git
 
33
  echo "CLIP installation is complete."
34
 
35
+ # Install diffusers
36
  pip install diffusers==0.20.2
 
37
  echo "Diffusers installation is complete. version: 0.20.2"
 
 
 
 
 
38
 
39
+ # Clone and set up DiffVG, handling dependencies on Ubuntu
40
  git clone https://github.com/BachiLi/diffvg.git
41
  cd diffvg
42
  git submodule update --init --recursive
43
+
44
+ # Install system dependencies for Ubuntu (to avoid potential issues)
45
+ echo "Installing system dependencies for DiffVG..."
46
+ sudo apt update
47
+ sudo apt install -y cmake ffmpeg build-essential libjpeg-dev libpng-dev libtiff-dev
48
+
49
  conda install -y -c anaconda cmake
50
  conda install -y -c conda-forge ffmpeg
51
  pip install svgwrite svgpathtools cssutils torch-tools
 
52
 
53
+ # Install DiffVG
54
+ python setup.py install
55
  echo "DiffVG installation is complete."
56
 
57
+ # Final confirmation
58
+ echo "The running environment has been successfully installed!!!"