new test torch
Browse files- Dockerfile +8 -7
- app.py +0 -30
Dockerfile
CHANGED
@@ -5,9 +5,10 @@ WORKDIR /code
|
|
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 torch==1.9.1
|
9 |
-
RUN pip install -
|
10 |
-
RUN
|
|
|
11 |
RUN mim install "mmcv>=2.0.1"
|
12 |
RUN mim install "mmdet>=3.1.0"
|
13 |
|
@@ -15,15 +16,15 @@ RUN git clone https://github.com/open-mmlab/mmpose.git
|
|
15 |
|
16 |
# Change directory to mmpose
|
17 |
WORKDIR /code/mmpose
|
18 |
-
RUN pip install -
|
19 |
-
RUN pip install -e .
|
20 |
|
21 |
# How do we change it back with ..
|
22 |
WORKDIR /..
|
23 |
|
24 |
# RUN mim install "mmpose>=1.1.0"
|
25 |
|
26 |
-
RUN pip install gradio
|
27 |
|
28 |
#https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
|
29 |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
@@ -45,4 +46,4 @@ WORKDIR $HOME/app
|
|
45 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
46 |
COPY --chown=user . $HOME/app
|
47 |
|
48 |
-
CMD ["python", "
|
|
|
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 torch==1.9.1 -f https://download.pytorch.org/whl/torch_stable.ht
|
9 |
+
RUN pip install torchvision==0.10.1 -f https://download.pytorch.org/whl/torch_stable.ht
|
10 |
+
RUN pip install --no-cache-dir --upgrade -U openmim
|
11 |
+
RUN mim install --no-cache-dir --upgrade mmengine
|
12 |
RUN mim install "mmcv>=2.0.1"
|
13 |
RUN mim install "mmdet>=3.1.0"
|
14 |
|
|
|
16 |
|
17 |
# Change directory to mmpose
|
18 |
WORKDIR /code/mmpose
|
19 |
+
RUN pip install --no-cache-dir --upgrade requirements.txt
|
20 |
+
RUN pip install --no-cache-dir --upgrade -e .
|
21 |
|
22 |
# How do we change it back with ..
|
23 |
WORKDIR /..
|
24 |
|
25 |
# RUN mim install "mmpose>=1.1.0"
|
26 |
|
27 |
+
RUN pip install --no-cache-dir --upgrade gradio
|
28 |
|
29 |
#https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
|
30 |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
|
|
46 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
47 |
COPY --chown=user . $HOME/app
|
48 |
|
49 |
+
CMD ["python", "main.py"]
|
app.py
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
import mmpose
|
2 |
-
print(mmpose.__version__)
|
3 |
-
from mmpose.apis import MMPoseInferencer
|
4 |
-
inferencer = MMPoseInferencer('human')
|
5 |
-
print("[INFO]: Imported modules!!")
|
6 |
-
|
7 |
-
import gradio as gr
|
8 |
-
|
9 |
-
def greet(photo):
|
10 |
-
print("[INFO]: Downloaded models!")
|
11 |
-
result_generator = inferencer(photo)
|
12 |
-
|
13 |
-
print("[INFO]: Visualizing results!")
|
14 |
-
vis, pred = next(result_generator)
|
15 |
-
return vis
|
16 |
-
|
17 |
-
# # specify detection model by alias
|
18 |
-
# # the available aliases include 'human', 'hand', 'face', 'animal',
|
19 |
-
# # as well as any additional aliases defined in mmdet
|
20 |
-
# inferencer = MMPoseInferencer(
|
21 |
-
# # suppose the pose estimator is trained on custom dataset
|
22 |
-
# pose2d='custom_human_pose_estimator.py',
|
23 |
-
# pose2d_weights='custom_human_pose_estimator.pth',
|
24 |
-
# det_model='human'
|
25 |
-
# )
|
26 |
-
if __name__ == '__main__':
|
27 |
-
|
28 |
-
demo = gr.Interface(fn=greet, inputs=gr.Image(source="webcam"), outputs=gr.Image())
|
29 |
-
|
30 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|