Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +66 -0
Dockerfile
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
|
| 5 |
+
# Set the MKL_THREADING_LAYER environment variable to GNU
|
| 6 |
+
ENV MKL_THREADING_LAYER=GNU
|
| 7 |
+
|
| 8 |
+
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0 build-essential cmake aria2
|
| 9 |
+
|
| 10 |
+
RUN useradd -m -u 1000 user
|
| 11 |
+
|
| 12 |
+
USER user
|
| 13 |
+
|
| 14 |
+
ENV HOME=/home/user \
|
| 15 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 16 |
+
PYTHONPATH=$HOME/app \
|
| 17 |
+
PYTHONUNBUFFERED=1 \
|
| 18 |
+
GRADIO_ALLOW_FLAGGING=never \
|
| 19 |
+
GRADIO_NUM_PORTS=1 \
|
| 20 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 21 |
+
GRADIO_THEME=huggingface \
|
| 22 |
+
GRADIO_SHARE=False \
|
| 23 |
+
SYSTEM=spaces
|
| 24 |
+
|
| 25 |
+
# Set the working directory to the user's home directory
|
| 26 |
+
WORKDIR $HOME/app
|
| 27 |
+
|
| 28 |
+
RUN git clone -b dev https://github.com/camenduru/HandRefiner $HOME/app
|
| 29 |
+
RUN git clone -b dev --recursive https://github.com/camenduru/MeshGraphormer $HOME/app/MeshGraphormer
|
| 30 |
+
|
| 31 |
+
# Install dependencies
|
| 32 |
+
RUN pip install -q pytorch-lightning omegaconf einops yacs trimesh mediapipe rtree boto3
|
| 33 |
+
RUN pip install -q git+https://gitlab.eecs.umich.edu/ngv-python-modules/opendr
|
| 34 |
+
RUN pip install -q https://download.pytorch.org/whl/cu121/xformers-0.0.22.post7-cp310-cp310-manylinux2014_x86_64.whl
|
| 35 |
+
|
| 36 |
+
RUN pip install --no-cache-dir gradio opencv-python
|
| 37 |
+
|
| 38 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/basicModel_neutral_lbs_10_207_0_v1.0.0.pkl -d $HOME/app/MeshGraphormer/src/modeling/data -o basicModel_neutral_lbs_10_207_0_v1.0.0.pkl
|
| 39 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/MANO_RIGHT.pkl -d $HOME/app/MeshGraphormer/src/modeling/data -o MANO_RIGHT.pkl
|
| 40 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/graphormer_release/graphormer_3dpw_state_dict.bin -d $HOME/app/MeshGraphormer/models/graphormer_release -o graphormer_3dpw_state_dict.bin
|
| 41 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/graphormer_release/graphormer_h36m_state_dict.bin -d $HOME/app/MeshGraphormer/models/graphormer_release -o graphormer_h36m_state_dict.bin
|
| 42 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/graphormer_release/graphormer_hand_state_dict.bin -d $HOME/app/MeshGraphormer/models/graphormer_release -o graphormer_hand_state_dict.bin
|
| 43 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/raw/main/hrnet/cls_hrnet_w40_sgd_lr5e-2_wd1e-4_bs32_x100.yaml -d $HOME/app/MeshGraphormer/models/hrnet -o cls_hrnet_w40_sgd_lr5e-2_wd1e-4_bs32_x100.yaml
|
| 44 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/raw/main/hrnet/cls_hrnet_w64_sgd_lr5e-2_wd1e-4_bs32_x100.yaml -d $HOME/app/MeshGraphormer/models/hrnet -o cls_hrnet_w64_sgd_lr5e-2_wd1e-4_bs32_x100.yaml
|
| 45 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/hrnet/hrnetv2_w40_imagenet_pretrained.pth -d $HOME/app/MeshGraphormer/models/hrnet -o hrnetv2_w40_imagenet_pretrained.pth
|
| 46 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/hrnet/hrnetv2_w64_imagenet_pretrained.pth -d $HOME/app/MeshGraphormer/models/hrnet -o hrnetv2_w64_imagenet_pretrained.pth
|
| 47 |
+
|
| 48 |
+
WORKDIR $HOME/app/MeshGraphormer
|
| 49 |
+
RUN pip install -e .
|
| 50 |
+
RUN pip install -e ./manopth/.
|
| 51 |
+
|
| 52 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/hand_landmarker.task -d $HOME/app/preprocessor -o hand_landmarker.task
|
| 53 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/inpaint_depth_control.ckpt -d $HOME/app/models -o inpaint_depth_control.ckpt
|
| 54 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HandRefiner/resolve/main/ckpt200-multisc-pred.zip -d $HOME/app/MeshGraphormer/predictions -o ckpt200-multisc-pred.zip
|
| 55 |
+
RUN mkdir $HOME/app/output
|
| 56 |
+
|
| 57 |
+
WORKDIR $HOME/app
|
| 58 |
+
|
| 59 |
+
COPY app.py .
|
| 60 |
+
|
| 61 |
+
# Set the environment variable to specify the GPU device
|
| 62 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
| 63 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
| 64 |
+
|
| 65 |
+
# Run your app.py script
|
| 66 |
+
CMD ["python", "app.py"]
|