docker and app
Browse files- Dockerfile +40 -0
- app.py +0 -14
Dockerfile
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.8
|
| 2 |
+
|
| 3 |
+
WORKDIR /code
|
| 4 |
+
|
| 5 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
+
|
| 7 |
+
RUN pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.ht
|
| 8 |
+
RUN pip install -U openmim
|
| 9 |
+
RUN mim install "mmcv>=2.0.1"
|
| 10 |
+
RUN mim install mmengine
|
| 11 |
+
RUN git clone https://github.com/open-mmlab/mmpose.git
|
| 12 |
+
|
| 13 |
+
# Change directory to mmpose
|
| 14 |
+
RUN cd mmpose
|
| 15 |
+
RUN pip install -r requirements.txt
|
| 16 |
+
RUN pip install -e .
|
| 17 |
+
|
| 18 |
+
# How do we change it back with ..
|
| 19 |
+
RUN cd ..
|
| 20 |
+
RUN mim install "mmpose>=1.1.0"
|
| 21 |
+
|
| 22 |
+
RUN pip install gradio
|
| 23 |
+
|
| 24 |
+
# Set up a new user named "user" with user ID 1000
|
| 25 |
+
RUN useradd -m -u 1000 user
|
| 26 |
+
|
| 27 |
+
# Switch to the "user" user
|
| 28 |
+
USER user
|
| 29 |
+
|
| 30 |
+
# Set home to the user's home directory
|
| 31 |
+
ENV HOME=/home/user \
|
| 32 |
+
PATH=/home/user/.local/bin:$PATH
|
| 33 |
+
|
| 34 |
+
# Set the working directory to the user's home directory
|
| 35 |
+
WORKDIR $HOME/app
|
| 36 |
+
|
| 37 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 38 |
+
COPY --chown=user . $HOME/app
|
| 39 |
+
|
| 40 |
+
CMD ["python", "app.py"]
|
app.py
CHANGED
|
@@ -4,20 +4,6 @@ from mmpose.apis import MMPoseInferencer
|
|
| 4 |
inferencer = MMPoseInferencer(
|
| 5 |
pose3d='human')
|
| 6 |
|
| 7 |
-
# conda create -n mmpose python=3.8 -y
|
| 8 |
-
# conda activate mmpose
|
| 9 |
-
# pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
|
| 10 |
-
# pip install mmengine
|
| 11 |
-
|
| 12 |
-
# git clone https://github.com/open-mmlab/playground.git
|
| 13 |
-
# cd playground
|
| 14 |
-
|
| 15 |
-
# pip install -U openmim
|
| 16 |
-
# mim install "mmcv>=2.0.0"
|
| 17 |
-
|
| 18 |
-
# git clone https://github.com/open-mmlab/mmpose.git
|
| 19 |
-
# cd mmpose; pip install -e .; cd ..
|
| 20 |
-
|
| 21 |
import gradio as gr
|
| 22 |
|
| 23 |
def greet(photo):
|
|
|
|
| 4 |
inferencer = MMPoseInferencer(
|
| 5 |
pose3d='human')
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
|
| 9 |
def greet(photo):
|