Muhammad Taqi Raza commited on
Commit ·
88f9c64
1
Parent(s): ff53311
Clean initial commit without binaries
Browse files- Dockerfile +2 -2
- app.py +4 -4
Dockerfile
CHANGED
|
@@ -41,8 +41,8 @@ RUN pip install --no-cache-dir mediapipe==0.10.21
|
|
| 41 |
RUN pip install --no-cache-dir gradio accelerate modelscope huggingface_hub
|
| 42 |
|
| 43 |
# Set environments for models and Gradio
|
| 44 |
-
ENV FACECAM_MODELS_DIR=/
|
| 45 |
-
ENV FACECAM_CKPTS_DIR=/
|
| 46 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 47 |
ENV GRADIO_SERVER_PORT=7860
|
| 48 |
|
|
|
|
| 41 |
RUN pip install --no-cache-dir gradio accelerate modelscope huggingface_hub
|
| 42 |
|
| 43 |
# Set environments for models and Gradio
|
| 44 |
+
ENV FACECAM_MODELS_DIR=/app/models
|
| 45 |
+
ENV FACECAM_CKPTS_DIR=/app/ckpts
|
| 46 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 47 |
ENV GRADIO_SERVER_PORT=7860
|
| 48 |
|
app.py
CHANGED
|
@@ -56,8 +56,8 @@ def process_video(
|
|
| 56 |
if input_video is None:
|
| 57 |
raise gr.Error("Please upload an input video")
|
| 58 |
|
| 59 |
-
model_dir = os.environ.get("FACECAM_MODELS_DIR", "/
|
| 60 |
-
ckpt_dir = os.environ.get("FACECAM_CKPTS_DIR", "/
|
| 61 |
|
| 62 |
# Optional: ensure weights are downloaded lazily if not done at startup
|
| 63 |
progress(0.0, desc="Checking weights...")
|
|
@@ -167,8 +167,8 @@ with gr.Blocks(title="FaceCam: Portrait Video Camera Control", theme=gr.themes.B
|
|
| 167 |
|
| 168 |
if __name__ == "__main__":
|
| 169 |
# Pre-download models on startup if necessary
|
| 170 |
-
model_dir = os.environ.get("FACECAM_MODELS_DIR", "/
|
| 171 |
-
ckpt_dir = os.environ.get("FACECAM_CKPTS_DIR", "/
|
| 172 |
download_weights(model_dir, ckpt_dir)
|
| 173 |
|
| 174 |
demo.launch(server_name="0.0.0.0", server_port=7860, share=False)
|
|
|
|
| 56 |
if input_video is None:
|
| 57 |
raise gr.Error("Please upload an input video")
|
| 58 |
|
| 59 |
+
model_dir = os.environ.get("FACECAM_MODELS_DIR", "/app/models")
|
| 60 |
+
ckpt_dir = os.environ.get("FACECAM_CKPTS_DIR", "/app/ckpts")
|
| 61 |
|
| 62 |
# Optional: ensure weights are downloaded lazily if not done at startup
|
| 63 |
progress(0.0, desc="Checking weights...")
|
|
|
|
| 167 |
|
| 168 |
if __name__ == "__main__":
|
| 169 |
# Pre-download models on startup if necessary
|
| 170 |
+
model_dir = os.environ.get("FACECAM_MODELS_DIR", "/app/models")
|
| 171 |
+
ckpt_dir = os.environ.get("FACECAM_CKPTS_DIR", "/app/ckpts")
|
| 172 |
download_weights(model_dir, ckpt_dir)
|
| 173 |
|
| 174 |
demo.launch(server_name="0.0.0.0", server_port=7860, share=False)
|