Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +30 -0
Dockerfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Start with an official PyTorch Docker image with CUDA support for GPU acceleration
|
| 2 |
+
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
|
| 3 |
+
|
| 4 |
+
# Install essential packages
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
git \
|
| 7 |
+
wget \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Install Hugging Face Transformers, TorchScript, and additional dependencies
|
| 11 |
+
RUN pip install torch torchvision transformers requests
|
| 12 |
+
|
| 13 |
+
# Clone Meta Sapiens Pose model and MotionBERT model from Hugging Face
|
| 14 |
+
RUN mkdir /models
|
| 15 |
+
WORKDIR /models
|
| 16 |
+
|
| 17 |
+
# Meta Sapiens Pose Model
|
| 18 |
+
RUN git clone https://huggingface.co/facebook/sapiens-pose-1b-torchscript /models/sapiens_pose
|
| 19 |
+
|
| 20 |
+
# MotionBERT Model
|
| 21 |
+
RUN git clone https://huggingface.co/walterzhu/MotionBERT /models/motionbert
|
| 22 |
+
|
| 23 |
+
# Copy the inference script
|
| 24 |
+
COPY app.py /app/app.py
|
| 25 |
+
|
| 26 |
+
# Expose port for Flask app
|
| 27 |
+
EXPOSE 7860
|
| 28 |
+
|
| 29 |
+
# Run the inference script
|
| 30 |
+
CMD ["python", "/app/app.py"]
|