docker changes
Browse files- Dockerfile +9 -2
- main_noweb.py +8 -7
Dockerfile
CHANGED
@@ -8,7 +8,7 @@ COPY ./requirements.txt /code/requirements.txt
|
|
8 |
#https://download.pytorch.org/whl/torch_stable.ht
|
9 |
|
10 |
#https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
|
11 |
-
RUN apt-get update && apt-get install python3.
|
12 |
|
13 |
RUN pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
|
14 |
# --index-url https://download.pytorch.org/whl/cu117
|
@@ -40,7 +40,14 @@ USER user
|
|
40 |
|
41 |
# Set home to the user's home directory
|
42 |
ENV HOME=/home/user \
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
# Set the working directory to the user's home directory
|
46 |
WORKDIR $HOME/app
|
|
|
8 |
#https://download.pytorch.org/whl/torch_stable.ht
|
9 |
|
10 |
#https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
|
11 |
+
RUN apt-get update && apt-get install python3.9 python3-pip git ffmpeg libsm6 libxext6 -y
|
12 |
|
13 |
RUN pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
|
14 |
# --index-url https://download.pytorch.org/whl/cu117
|
|
|
40 |
|
41 |
# Set home to the user's home directory
|
42 |
ENV HOME=/home/user \
|
43 |
+
PATH=/home/user/.local/bin:$PATH \
|
44 |
+
PYTHONPATH=$HOME/app \
|
45 |
+
PYTHONUNBUFFERED=1 \
|
46 |
+
GRADIO_ALLOW_FLAGGING=never \
|
47 |
+
GRADIO_NUM_PORTS=1 \
|
48 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
49 |
+
GRADIO_THEME=huggingface \
|
50 |
+
SYSTEM=spaces
|
51 |
|
52 |
# Set the working directory to the user's home directory
|
53 |
WORKDIR $HOME/app
|
main_noweb.py
CHANGED
@@ -246,22 +246,22 @@ with block:
|
|
246 |
submit_pose_file.click(fn=pose2d,
|
247 |
inputs= [video_input, file_kpthr],
|
248 |
outputs = [video_output1, jsonoutput],
|
249 |
-
queue=
|
250 |
|
251 |
submit_pose3d_file.click(fn=pose3d,
|
252 |
inputs= video_input,
|
253 |
outputs = video_output2,
|
254 |
-
queue=
|
255 |
|
256 |
submit_hand_file.click(fn=pose2dhand,
|
257 |
inputs= [video_input, file_kpthr],
|
258 |
outputs = video_output3,
|
259 |
-
queue=
|
260 |
|
261 |
submit_detect_file.click(fn=show_tracking,
|
262 |
inputs= video_input,
|
263 |
outputs = video_output4,
|
264 |
-
queue=
|
265 |
|
266 |
if __name__ == "__main__":
|
267 |
block.queue(
|
@@ -269,8 +269,9 @@ if __name__ == "__main__":
|
|
269 |
max_size=25, # Maximum number of requests that the queue processes
|
270 |
api_open = False # When creating a Gradio demo, you may want to restrict all traffic to happen through the user interface as opposed to the programmatic API that is automatically created for your Gradio demo.
|
271 |
) # https://www.gradio.app/guides/setting-up-a-demo-for-maximum-performance
|
272 |
-
block.launch(server_name="0.0.0.0",
|
273 |
-
share=True
|
274 |
-
server_port=7860
|
|
|
275 |
|
276 |
|
|
|
246 |
submit_pose_file.click(fn=pose2d,
|
247 |
inputs= [video_input, file_kpthr],
|
248 |
outputs = [video_output1, jsonoutput],
|
249 |
+
queue=True)
|
250 |
|
251 |
submit_pose3d_file.click(fn=pose3d,
|
252 |
inputs= video_input,
|
253 |
outputs = video_output2,
|
254 |
+
queue=True)
|
255 |
|
256 |
submit_hand_file.click(fn=pose2dhand,
|
257 |
inputs= [video_input, file_kpthr],
|
258 |
outputs = video_output3,
|
259 |
+
queue=True)
|
260 |
|
261 |
submit_detect_file.click(fn=show_tracking,
|
262 |
inputs= video_input,
|
263 |
outputs = video_output4,
|
264 |
+
queue=True)
|
265 |
|
266 |
if __name__ == "__main__":
|
267 |
block.queue(
|
|
|
269 |
max_size=25, # Maximum number of requests that the queue processes
|
270 |
api_open = False # When creating a Gradio demo, you may want to restrict all traffic to happen through the user interface as opposed to the programmatic API that is automatically created for your Gradio demo.
|
271 |
) # https://www.gradio.app/guides/setting-up-a-demo-for-maximum-performance
|
272 |
+
block.launch(#server_name="0.0.0.0",
|
273 |
+
share=True#,
|
274 |
+
#server_port=7860
|
275 |
+
)
|
276 |
|
277 |
|