forked from fangfufu/Linux-Fake-Background-Webcam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-gpu.yml
50 lines (46 loc) · 1.5 KB
/
docker-compose-gpu.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: '3.7'
# We use a cache for CUDA so only the first startup takes a lot of time (> 5 min.)
# https://developer.nvidia.com/blog/cuda-pro-tip-understand-fat-binaries-jit-caching/
services:
bodypix-gpu:
image: bodypix-gpu
init: true
build:
context: ./bodypix
dockerfile: Dockerfile-gpu
read_only: true
volumes:
- communication_volume:/socket
- compute_cache:/root/.nv/ComputeCache
environment:
- PORT=/socket/bodypix.sock
- CUDA_CACHE_MAXSIZE=2147483647
- CUDA_CACHE_DISABLE=0
- CUDA_CACHE_PATH=/root/.nv/ComputeCache
shm_size: 1gb
ulimits:
memlock: -1
stack: 67108864
runtime: nvidia
fakecam-gpu:
image: fakecam-gpu
init: true
build:
context: ./fakecam
read_only: true
volumes:
- communication_volume:/socket
- ${BACKGROUND_IMAGE_PATH}:/src/background.jpg:ro
- ${FOREGROUND_IMAGE_PATH}:/src/foreground.jpg:ro
- ${FOREGROUND_MASK_IMAGE_PATH}:/src/foreground-mask.png:ro
devices:
# input (webcam)
- ${INPUT_DEVICE}:/dev/video0
# output (virtual webcam)
- ${OUTPUT_DEVICE}:/dev/video2
depends_on:
- bodypix-gpu
command: --bodypix-url /socket/bodypix.sock ${FAKE_PY_ADDITIONAL_OPTIONS_GPU}
volumes:
communication_volume:
compute_cache: