You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 1.8 kB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM nvidia/cuda:10.1-cudnn7-devel
  2. # To use this Dockerfile:
  3. # 1. `nvidia-docker build -t detectron2:v0 .`
  4. # 2. `nvidia-docker run -it --name detectron2 detectron2:v0`
  5. #
  6. # To enable GUI support (Linux):
  7. # 1. Grant the container temporary access to your x server (will be reverted at reboot of your host):
  8. # `xhost +local:`docker inspect --format='{{ .Config.Hostname }}' detectron2``
  9. # 2. `nvidia-docker run -it --name detectron2 --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" detectron2:v0`
  10. ENV DEBIAN_FRONTEND noninteractive
  11. RUN apt-get update && apt-get install -y \
  12. libpng-dev libjpeg-dev python3-opencv ca-certificates \
  13. python3-dev build-essential pkg-config git curl wget automake libtool && \
  14. rm -rf /var/lib/apt/lists/*
  15. RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \
  16. python3 get-pip.py && \
  17. rm get-pip.py
  18. # install dependencies
  19. # See https://pytorch.org/ for other options if you use a different version of CUDA
  20. RUN pip install torch torchvision cython \
  21. 'git+https://github.com/facebookresearch/fvcore'
  22. RUN pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
  23. # install detectron2
  24. RUN git clone https://github.com/facebookresearch/detectron2 /detectron2_repo
  25. ENV FORCE_CUDA="1"
  26. ENV TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
  27. RUN pip install -e /detectron2_repo
  28. WORKDIR /detectron2_repo
  29. # run it, for example:
  30. # wget http://images.cocodataset.org/val2017/000000439715.jpg -O input.jpg
  31. # python3 demo/demo.py \
  32. #--config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
  33. #--input input.jpg --output outputs/ \
  34. #--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

No Description