Spaces:
Runtime error
Runtime error
jhj0517
commited on
Commit
·
e1b34b8
1
Parent(s):
e4a303a
Enable gpu in docker-compose
Browse files- Dockerfile +1 -0
- docker-compose.yaml +18 -5
Dockerfile
CHANGED
|
@@ -14,6 +14,7 @@ RUN python3 -m venv venv && \
|
|
| 14 |
. venv/bin/activate && \
|
| 15 |
pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
|
|
|
| 17 |
# Runtime Stage
|
| 18 |
FROM debian:bookworm-slim AS runtime
|
| 19 |
|
|
|
|
| 14 |
. venv/bin/activate && \
|
| 15 |
pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
|
| 18 |
# Runtime Stage
|
| 19 |
FROM debian:bookworm-slim AS runtime
|
| 20 |
|
docker-compose.yaml
CHANGED
|
@@ -6,13 +6,26 @@ services:
|
|
| 6 |
image: jhj0517/sam2-playground:latest
|
| 7 |
|
| 8 |
volumes:
|
| 9 |
-
#
|
| 10 |
# - C:/sam2-models/custom/path:/sam2-playground/models
|
| 11 |
# - C:/sam2-playground-outputs/custom/path:/sam2-playground/outputs
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
|
| 15 |
ports:
|
| 16 |
-
- "
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
image: jhj0517/sam2-playground:latest
|
| 7 |
|
| 8 |
volumes:
|
| 9 |
+
# Update paths to mount models and output paths to your custom paths, e.g:
|
| 10 |
# - C:/sam2-models/custom/path:/sam2-playground/models
|
| 11 |
# - C:/sam2-playground-outputs/custom/path:/sam2-playground/outputs
|
| 12 |
+
- C:\FaceParsing_Project\sam2-playground\models:/sam2-playground/models
|
| 13 |
+
- C:\FaceParsing_Project\sam2-playground\models:/sam2-playground/outputs
|
| 14 |
|
| 15 |
ports:
|
| 16 |
+
- "7860:7860"
|
| 17 |
|
| 18 |
+
stdin_open: true
|
| 19 |
+
tty: true
|
| 20 |
+
|
| 21 |
+
entrypoint: ["python", "app.py", "--server_port", "7860", "--server_name", "0.0.0.0",]
|
| 22 |
+
|
| 23 |
+
# If you're not using nvidia GPU, Update device to match yours.
|
| 24 |
+
# See more info at : https://docs.docker.com/compose/compose-file/deploy/#driver
|
| 25 |
+
deploy:
|
| 26 |
+
resources:
|
| 27 |
+
reservations:
|
| 28 |
+
devices:
|
| 29 |
+
- driver: nvidia
|
| 30 |
+
count: all
|
| 31 |
+
capabilities: [ gpu ]
|