Spaces:
Running on T4
Running on T4
Download Dockerfile.gvhmr from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.97 kB
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/Dockerfile.gvhmr
- Command line
-
hf download hf://spaces/modventures/baseball-engine/Dockerfile.gvhmr
-
curl -L -o Dockerfile.gvhmr https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/Dockerfile.gvhmr
1.97 kB
| # Optional image with the complete GVHMR interpreter installed at build time. | |
| ARG BASE_IMAGE=baseball-engine-api:local | |
| FROM python:3.11-slim-bookworm AS gvhmr-runtime | |
| ENV UV_PYTHON_INSTALL_DIR=/opt/gvhmr-python UV_LINK_MODE=copy | |
| RUN apt-get update && apt-get install -y --no-install-recommends git libgl1 libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements-gvhmr.txt /tmp/requirements-gvhmr.txt | |
| COPY tools/check_gvhmr_runtime.py /tmp/check_gvhmr_runtime.py | |
| RUN python -m pip install --no-cache-dir uv==0.9.10 \ | |
| && python -m uv python install 3.10 \ | |
| && python -m uv venv --python 3.10 --seed /opt/gvhmr-runtime \ | |
| && /opt/gvhmr-runtime/bin/python -m pip install --no-cache-dir -r /tmp/requirements-gvhmr.txt \ | |
| && git init /opt/gvhmr-source \ | |
| && git -C /opt/gvhmr-source remote add origin https://github.com/zju3dv/GVHMR.git \ | |
| && git -C /opt/gvhmr-source fetch --depth=1 origin ee960bb6e2ea2d381aa97f08e9b71ef320b624b1 \ | |
| && git -C /opt/gvhmr-source checkout --detach ee960bb6e2ea2d381aa97f08e9b71ef320b624b1 \ | |
| && PYTHONPATH=/opt/gvhmr-source /opt/gvhmr-runtime/bin/python /tmp/check_gvhmr_runtime.py | |
| COPY baseball_batting /opt/gvhmr-api-check/baseball_batting | |
| RUN PYTHONPATH=/opt/gvhmr-api-check:/opt/gvhmr-source /opt/gvhmr-runtime/bin/python -c \ | |
| "import numpy as np; from baseball_batting.gvhmr_pose_worker import run; from baseball_batting.motion_refine_worker import load_adapter; from baseball_batting.motion_refinement import fit_window; from baseball_batting.motion_adapters import smplx_to_calculation; from smplx.joint_names import JOINT_NAMES; assert smplx_to_calculation(np.zeros((2,len(JOINT_NAMES),3)),JOINT_NAMES).shape == (2,70,3)" | |
| FROM ${BASE_IMAGE} | |
| COPY --from=gvhmr-runtime /opt/gvhmr-python /opt/gvhmr-python | |
| COPY --from=gvhmr-runtime /opt/gvhmr-runtime /opt/gvhmr-runtime | |
| COPY --chown=1000:1000 --from=gvhmr-runtime /opt/gvhmr-source /opt/gvhmr-source | |
| ENV BASEBALL_GVHMR_SOURCE=/opt/gvhmr-source | |