Arulkumar03/Fox_Sheep_Detector_Computer_Vision_model
0
1FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.042# use an older system (18.04) to avoid opencv incompatibility (issue#3524)3 4ENV DEBIAN_FRONTEND noninteractive5RUN apt-get update && apt-get install -y \6 python3-opencv ca-certificates python3-dev git wget sudo ninja-build7RUN ln -sv /usr/bin/python3 /usr/bin/python8 9# create a non-root user10ARG USER_ID=100011RUN useradd -m --no-log-init --system --uid ${USER_ID} appuser -g sudo12RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers13USER appuser14WORKDIR /home/appuser15 16ENV PATH="/home/appuser/.local/bin:${PATH}"17RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py && \18 python3 get-pip.py --user && \19 rm get-pip.py20 21# install dependencies22# See https://pytorch.org/ for other options if you use a different version of CUDA23RUN pip install --user tensorboard cmake onnx # cmake from apt-get is too old24RUN pip install --user torch==1.10 torchvision==0.11.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html25 26RUN pip install --user 'git+https://github.com/facebookresearch/fvcore'27# install detectron228RUN git clone https://github.com/facebookresearch/detectron2 detectron2_repo29# set FORCE_CUDA because during `docker build` cuda is not accessible30ENV FORCE_CUDA="1"31# This will by default build detectron2 for all common cuda architectures and take a lot more time,32# because inside `docker build`, there is no way to tell which architecture will be used.33ARG TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"34ENV TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST}"35 36RUN pip install --user -e detectron2_repo37 38# Set a fixed model cache directory.39ENV FVCORE_CACHE="/tmp"40WORKDIR /home/appuser/detectron2_repo41 42# run detectron2 under user "appuser":43# wget http://images.cocodataset.org/val2017/000000439715.jpg -O input.jpg44# python3 demo/demo.py \45 #--config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \46 #--input input.jpg --output outputs/ \47 #--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl48 