diff --git a/Dockerfile b/Dockerfile index 44543409..195e2dec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ RUN pip install -U gsutil # RUN conda install -y -c anaconda future numpy opencv matplotlib tqdm pillow # RUN conda install -y -c conda-forge scikit-image tensorboard pycocotools -# Install OpenCV with Gstreamer support +## Install OpenCV with Gstreamer support #WORKDIR /usr/src #RUN pip uninstall -y opencv-python #RUN apt-get update -#RUN apt-get install -y gstreamer1.0-python3-dbg-plugin-loader libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev +#RUN apt-get install -y gstreamer1.0-tools gstreamer1.0-python3-dbg-plugin-loader libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev #RUN git clone https://github.com/opencv/opencv.git && cd opencv && git checkout 4.1.1 && mkdir build #RUN git clone https://github.com/opencv/opencv_contrib.git && cd opencv_contrib && git checkout 4.1.1 #RUN cd opencv/build && cmake ../ \ @@ -22,7 +22,7 @@ RUN pip install -U gsutil # -D PYTHON3_INCLUDE_PATH=/opt/conda/include/python3.6m \ # -D PYTHON3_LIBRARIES=/opt/conda/lib/python3.6/site-packages \ # -D WITH_GSTREAMER=ON \ -# -D WITH_FFMPEG=ON \ +# -D WITH_FFMPEG=OFF \ # && make && make install && ldconfig #RUN cd /usr/local/lib/python3.6/site-packages/cv2/python-3.6/ && mv cv2.cpython-36m-x86_64-linux-gnu.so cv2.so #RUN cd /opt/conda/lib/python3.6/site-packages/ && ln -s /usr/local/lib/python3.6/site-packages/cv2/python-3.6/cv2.so cv2.so diff --git a/test.py b/test.py index be4cf627..54cac3c1 100644 --- a/test.py +++ b/test.py @@ -20,7 +20,7 @@ def test(cfg, model=None): # Initialize/load model and set device if model is None: - device = torch_utils.select_device() + device = torch_utils.select_device(opt.device) verbose = True # Initialize model @@ -204,6 +204,7 @@ if __name__ == '__main__': parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold') parser.add_argument('--nms-thres', type=float, default=0.5, help='iou threshold for non-maximum suppression') parser.add_argument('--save-json', action='store_true', help='save a cocoapi-compatible JSON results file') + parser.add_argument('--device', default='', help='device id (i.e. 0 or 0,1) or cpu') opt = parser.parse_args() print(opt)