-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset-up-dependencies.sh
executable file
·53 lines (40 loc) · 1.27 KB
/
set-up-dependencies.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
47
48
49
50
51
52
53
# Install build essential
apt-get install -y build-essential
# Install pip
apt-get update
apt-get install python3-pip -y
apt-get install python3.11-venv -y
# Set up venv
python3 -m venv wranglervenv
source wranglervenv/bin/activate
# Install requirements
pip3 install -r ./imap-client/requirements.txt
# Install pytorch cpu
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
# Install easyocr
pip3 install easyocr
# Add lsb-release
apt-get update -y -qq
apt-get install apt-utils -y -qq
apt-get install lsb-release -y -qq
# Install dev files
apt-get install -y -qq libtesseract-dev libleptonica-dev
# Make sure english is installed
apt-get install -y -qq tesseract-ocr-eng
# Build ImageMagick from source
apt-get install git -y -qq
apt-get install pkg-config -y -qq
apt-get install -y -qq libmagickwand-dev
# Clone ImageMagick
git clone --depth 1 https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1
# Build ImageMagick
cd ImageMagick-7.1.1
./configure
make
make install
ldconfig
# Cleanup
cd ..
rm -rf ImageMagick-7.1.1
# Adjust imageMagick policy to allow for pdf conversion
sed -i 's|<policy domain="coder" rights="none" pattern="PDF" />|<policy domain="coder" rights="read\|write" pattern="PDF" />|g' /usr/local/etc/ImageMagick-7/policy.xml