Spaces:
Running
on
Zero
Running
on
Zero
myniu
commited on
Commit
•
19dfd38
1
Parent(s):
995bdf7
init
Browse files- Dockerfile +42 -0
- app.py +2 -0
- requirements.txt +3 -4
Dockerfile
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
|
2 |
+
|
3 |
+
ARG DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
ENV PYTHONUNBUFFERED=1
|
6 |
+
|
7 |
+
RUN apt-get update && apt-get install --no-install-recommends -y \
|
8 |
+
build-essential \
|
9 |
+
python3.10 \
|
10 |
+
python3-pip \
|
11 |
+
git \
|
12 |
+
ffmpeg \
|
13 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
14 |
+
|
15 |
+
WORKDIR /code
|
16 |
+
|
17 |
+
COPY ./requirements.txt /code/requirements.txt
|
18 |
+
|
19 |
+
# Set up a new user named "user" with user ID 1000
|
20 |
+
RUN useradd -m -u 1000 user
|
21 |
+
# Switch to the "user" user
|
22 |
+
USER user
|
23 |
+
# Set home to the user's home directory
|
24 |
+
ENV HOME=/home/user \
|
25 |
+
PATH=/home/user/.local/bin:$PATH \
|
26 |
+
PYTHONPATH=$HOME/app \
|
27 |
+
PYTHONUNBUFFERED=1 \
|
28 |
+
GRADIO_ALLOW_FLAGGING=never \
|
29 |
+
GRADIO_NUM_PORTS=1 \
|
30 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
31 |
+
GRADIO_THEME=huggingface \
|
32 |
+
SYSTEM=spaces
|
33 |
+
|
34 |
+
RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
|
35 |
+
|
36 |
+
# Set the working directory to the user's home directory
|
37 |
+
WORKDIR $HOME/app
|
38 |
+
|
39 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
40 |
+
COPY --chown=user . $HOME/app
|
41 |
+
|
42 |
+
CMD ["python3", "app.py"]
|
app.py
CHANGED
@@ -38,6 +38,8 @@ output_dir_frame = "./outputs/frames"
|
|
38 |
ensure_dirname(output_dir_video)
|
39 |
ensure_dirname(output_dir_frame)
|
40 |
|
|
|
|
|
41 |
|
42 |
def divide_points_afterinterpolate(resized_all_points, motion_brush_mask):
|
43 |
k = resized_all_points.shape[0]
|
|
|
38 |
ensure_dirname(output_dir_video)
|
39 |
ensure_dirname(output_dir_frame)
|
40 |
|
41 |
+
os.system('nvcc -V')
|
42 |
+
|
43 |
|
44 |
def divide_points_afterinterpolate(resized_all_points, motion_brush_mask):
|
45 |
k = resized_all_points.shape[0]
|
requirements.txt
CHANGED
@@ -3,14 +3,13 @@ gradio==4.5.0
|
|
3 |
opencv-python
|
4 |
opencv-python-headless
|
5 |
scikit-image
|
6 |
-
|
7 |
-
|
8 |
-
torchvision
|
9 |
einops
|
10 |
accelerate==0.30.1
|
11 |
transformers==4.41.1
|
12 |
colorlog
|
13 |
-
cupy-
|
14 |
av
|
15 |
gpustat
|
16 |
|
|
|
3 |
opencv-python
|
4 |
opencv-python-headless
|
5 |
scikit-image
|
6 |
+
torch==2.0.1
|
7 |
+
torchvision==0.15.2
|
|
|
8 |
einops
|
9 |
accelerate==0.30.1
|
10 |
transformers==4.41.1
|
11 |
colorlog
|
12 |
+
cupy-cuda117
|
13 |
av
|
14 |
gpustat
|
15 |
|