Spaces:
Building
Building
Update Dockerfile
Browse files- Dockerfile +6 -6
Dockerfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
FROM continuumio/miniconda3:24.1.2-0
|
4 |
|
5 |
-
#
|
6 |
RUN mkdir -p /usr/share/man/man1
|
7 |
RUN apt-get update && \
|
8 |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
|
@@ -29,16 +29,16 @@ RUN pip install mmdet==2.27.0
|
|
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
|
33 |
|
34 |
-
#
|
35 |
RUN git clone https://github.com/jin-s13/xtcocoapi.git
|
36 |
WORKDIR xtcocoapi
|
37 |
RUN pip install -r requirements.txt
|
38 |
RUN python setup.py install
|
39 |
WORKDIR /
|
40 |
|
41 |
-
#
|
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,7 +63,7 @@ USER appuser
|
|
63 |
|
64 |
EXPOSE 7860
|
65 |
|
66 |
-
# Start TorchServe, warm-up models, then run the
|
67 |
# Using xvfb-run for headless rendering.
|
68 |
CMD sh -c "\
|
69 |
torchserve --start --ncs --ts-config /home/torchserve/config.properties && \
|
@@ -71,5 +71,5 @@ CMD sh -c "\
|
|
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
|
75 |
"
|
|
|
2 |
|
3 |
FROM continuumio/miniconda3:24.1.2-0
|
4 |
|
5 |
+
# install os dependencies including xauth for xvfb
|
6 |
RUN mkdir -p /usr/share/man/man1
|
7 |
RUN apt-get update && \
|
8 |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
|
|
|
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 gradio
|
33 |
|
34 |
+
# bugfix for xtcocoapi, a dependency of mmpose
|
35 |
RUN git clone https://github.com/jin-s13/xtcocoapi.git
|
36 |
WORKDIR xtcocoapi
|
37 |
RUN pip install -r requirements.txt
|
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 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 python app.py \
|
75 |
"
|