forked from facebookresearch/detectron2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile (fix facebookresearch#14)
- Loading branch information
Showing
4 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM nvidia/cuda:10.1-cudnn7-devel | ||
# To use this Dockerfile: | ||
# 1. `nvidia-docker build -t detectron2:v0 .` | ||
# 2. `nvidia-docker run -it --name detectron2 detectron2:v0` | ||
|
||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && apt-get install -y \ | ||
libpng-dev libjpeg-dev python3-opencv ca-certificates \ | ||
python3-dev build-essential pkg-config git curl wget automake libtool && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \ | ||
python3 get-pip.py && \ | ||
rm get-pip.py | ||
|
||
# install dependencies | ||
RUN pip install torch torchvision cython \ | ||
'git+https://github.com/facebookresearch/fvcore' | ||
RUN pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI' | ||
|
||
# install detectron2 | ||
RUN git clone https://github.com/facebookresearch/detectron2 /detectron2_repo | ||
ENV FORCE_CUDA="1" | ||
RUN pip install -e /detectron2_repo | ||
|
||
WORKDIR /detectron2_repo | ||
|
||
# run it, for example: | ||
# wget http://images.cocodataset.org/val2017/000000439715.jpg -O input.jpg | ||
# python3 demo/demo.py \ | ||
#--config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \ | ||
#--input input.jpg \ | ||
#--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters