Spaces:
Sleeping
Sleeping
File size: 998 Bytes
77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 77902b8 65c9437 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# Base image with PyTorch and CUDA for GPU support
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages including Hugging Face Transformers, TorchScript, and Flask
RUN pip install --no-cache-dir \
torch \
torchvision \
transformers \
requests \
Flask # Explicitly add Flask here
# Create a working directory for model files
RUN mkdir /models
WORKDIR /models
# Download Meta Sapiens Pose model from Hugging Face Hub
RUN git clone https://huggingface.co/facebook/sapiens-pose-1b-torchscript /models/sapiens_pose
# Download MotionBERT model from Hugging Face Hub
RUN git clone https://huggingface.co/walterzhu/MotionBERT /models/motionbert
# Copy the inference script (app.py) into the container
COPY app.py /app/app.py
# Expose the default port for Flask
EXPOSE 7860
# Run the Flask app
CMD ["python", "/app/app.py"]
|