forked from skypilot-org/skypilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
detectron2_docker.yaml
40 lines (35 loc) · 1.38 KB
/
detectron2_docker.yaml
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
# Steps to run this example:
#
# (1) Run the following commands locally to get the example input image.
# mkdir -p ~/Downloads/detectron-inputs
# wget http://images.cocodataset.org/val2017/000000439715.jpg -O ~/Downloads/detectron-inputs/input.jpg
#
# (2) Change L18 to a unique bucket name to create a private bucket.
resources:
accelerators: V100:4
file_mounts:
# TODO: run the download commands above first.
/inputs: ~/Downloads/detectron-inputs
/detectron2: ./examples/docker/detectron2
/outputs:
# TODO: Change the name to your own bucket name (e.g., append your user name).
name: sky-detectron2-outputs
mode: MOUNT
setup: |
# Build:
sudo apt update
docker build --build-arg USER_ID=$UID -t detectron2:v0 /detectron2
run: |
# Launch (require GPUs):
docker run -a stdout -a stderr --gpus=all --pid=host --rm \
--shm-size=8gb \
--volume=$HOME/.torch/fvcore_cache:/tmp:rw \
--volume="/inputs:/inputs:ro" \
--volume="/outputs:/outputs:rw" \
detectron2:v0 /bin/bash -c \
"echo CUDA_VISIBLE_DEVICES $CUDA_VISIBLE_DEVICES && \
sudo chmod -R 777 /tmp && \
python3 demo/demo.py \
--config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
--input /inputs/input.jpg --output /outputs \
--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl"