-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdocker_visualize.py
More file actions
31 lines (27 loc) · 1.15 KB
/
docker_visualize.py
File metadata and controls
31 lines (27 loc) · 1.15 KB
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
#!/bin/bash
# docker_visualize.sh
#
# Usage:
# bash docker_visualize.sh <trained_model_location> <scene_location> <port> <ip> [additional host_render_server.py flags]
#
# This script mounts the model and scene directories into the container at /data/trained_model and /data/scene,
# exposes the specified port on the given IP, and then executes:
# python host_render_server.py -m /data/trained_model -s /data/scene --port <port> --ip <ip> [extra flags]
if [ "$#" -lt 4 ]; then
echo "Usage: $0 <trained_model_location> <scene_location> <port> <ip> [additional host_render_server.py flags]"
exit 1
fi
TRAINED_MODEL_LOCATION="$1"
SCENE_LOCATION="$2"
PORT="${3:-6009}"
IP="${4:-127.0.0.1}"
shift 4
docker run --rm --gpus all -it \
-v /tmp/NVIDIA:/tmp/NVIDIA \
-e NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility \
-v "$TRAINED_MODEL_LOCATION":/data/trained_model \
-v "$SCENE_LOCATION":/data/scene \
-p "$IP:$PORT:$PORT" \
-v "$(pwd)":/ever_training2 \
ever \
bash -c "source activate ever && cd /ever_training2 && rm -r ever && cp -r /ever_training/ever . && python host_render_server.py -m /data/trained_model -s /data/scene --port $PORT --ip $IP $*"