Spaces:
Building
Building
Update Dockerfile
Browse files- Dockerfile +4 -5
Dockerfile
CHANGED
@@ -19,7 +19,6 @@ RUN apt-get update && \
|
|
19 |
xauth \
|
20 |
&& rm -rf /var/lib/apt/lists/*
|
21 |
|
22 |
-
# Install Python 3.8.13
|
23 |
RUN conda install python=3.8.13 -y
|
24 |
|
25 |
# Install Python and model dependencies
|
@@ -30,7 +29,7 @@ RUN pip install mmdet==2.27.0
|
|
30 |
RUN pip install torchserve
|
31 |
RUN pip install mmpose==0.29.0
|
32 |
RUN pip install torchvision==0.15.1
|
33 |
-
RUN pip install numpy==1.24.4 scikit-image scipy opencv-python requests pyyaml flask
|
34 |
|
35 |
# Bugfix for xtcocoapi, a dependency of mmpose
|
36 |
RUN git clone https://github.com/jin-s13/xtcocoapi.git
|
@@ -39,7 +38,7 @@ RUN pip install -r requirements.txt
|
|
39 |
RUN python setup.py install
|
40 |
WORKDIR /
|
41 |
|
42 |
-
#
|
43 |
RUN mkdir -p /home/torchserve/model-store
|
44 |
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
|
45 |
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/
|
@@ -64,7 +63,7 @@ USER appuser
|
|
64 |
|
65 |
EXPOSE 7860
|
66 |
|
67 |
-
# Start TorchServe, warm-up models, then run the
|
68 |
# Using xvfb-run for headless rendering.
|
69 |
CMD sh -c "\
|
70 |
torchserve --start --ncs --ts-config /home/torchserve/config.properties && \
|
@@ -72,5 +71,5 @@ CMD sh -c "\
|
|
72 |
# Warm-up requests with a small test image to load models into memory.
|
73 |
curl -X POST http://localhost:8080/predictions/drawn_humanoid_detector -F image=@/app/examples/test.png && \
|
74 |
curl -X POST http://localhost:8080/predictions/drawn_humanoid_pose_estimator -F image=@/app/examples/test.png && \
|
75 |
-
xvfb-run -a
|
76 |
"
|
|
|
19 |
xauth \
|
20 |
&& rm -rf /var/lib/apt/lists/*
|
21 |
|
|
|
22 |
RUN conda install python=3.8.13 -y
|
23 |
|
24 |
# Install Python and model dependencies
|
|
|
29 |
RUN pip install torchserve
|
30 |
RUN pip install mmpose==0.29.0
|
31 |
RUN pip install torchvision==0.15.1
|
32 |
+
RUN pip install numpy==1.24.4 scikit-image scipy opencv-python requests pyyaml flask glfw PyOpenGL Pillow shapely tqdm fastapi uvicorn gradio
|
33 |
|
34 |
# Bugfix for xtcocoapi, a dependency of mmpose
|
35 |
RUN git clone https://github.com/jin-s13/xtcocoapi.git
|
|
|
38 |
RUN python setup.py install
|
39 |
WORKDIR /
|
40 |
|
41 |
+
# Prep TorchServe
|
42 |
RUN mkdir -p /home/torchserve/model-store
|
43 |
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
|
44 |
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/
|
|
|
63 |
|
64 |
EXPOSE 7860
|
65 |
|
66 |
+
# Start TorchServe, warm-up models, then run the FastAPI app.
|
67 |
# Using xvfb-run for headless rendering.
|
68 |
CMD sh -c "\
|
69 |
torchserve --start --ncs --ts-config /home/torchserve/config.properties && \
|
|
|
71 |
# Warm-up requests with a small test image to load models into memory.
|
72 |
curl -X POST http://localhost:8080/predictions/drawn_humanoid_detector -F image=@/app/examples/test.png && \
|
73 |
curl -X POST http://localhost:8080/predictions/drawn_humanoid_pose_estimator -F image=@/app/examples/test.png && \
|
74 |
+
xvfb-run -a uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860} \
|
75 |
"
|