File size: 1,340 Bytes
4125932
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fc30c85
4125932
 
 
 
 
 
 
 
 
 
 
fc30c85
 
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
#!/usr/bin/env bash
set -e

# install os dependencies
mkdir -p /usr/share/man/man1
apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
    ca-certificates \
    curl \
    vim \
    sudo \
    default-jre \
    git \
    gcc \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Install desired Python version
conda install python=3.8.13 -y

# install python dependencies
pip install openmim
pip install torch==2.0.0
mim install mmcv-full==1.7.0
pip install mmdet==2.27.0
pip install torchserve

# bugfix for xtcocoapi, an mmpose dependency
git clone https://github.com/jin-s13/xtcocoapi.git
cd xtcocoapi
pip install -r requirements.txt
python setup.py install
cd /

pip install mmpose==0.29.0
pip install torchvision==0.15.1  # solve torch version problem
pip install numpy==1.24.4        # solve numpy version problem

# prep torchserve
mkdir -p /home/torchserve/model-store
wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/

# Use absolute path to config.properties
cp /app/torchserve/config.properties /home/torchserve/config.properties