This commit is contained in:
Glenn Jocher 2019-09-16 14:31:07 +02:00
parent 1ecf80bc28
commit b62dc6f06a
2 changed files with 5 additions and 4 deletions

View File

@ -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 anaconda future numpy opencv matplotlib tqdm pillow
# RUN conda install -y -c conda-forge scikit-image tensorboard pycocotools # RUN conda install -y -c conda-forge scikit-image tensorboard pycocotools
# Install OpenCV with Gstreamer support ## Install OpenCV with Gstreamer support
#WORKDIR /usr/src #WORKDIR /usr/src
#RUN pip uninstall -y opencv-python #RUN pip uninstall -y opencv-python
#RUN apt-get update #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.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 git clone https://github.com/opencv/opencv_contrib.git && cd opencv_contrib && git checkout 4.1.1
#RUN cd opencv/build && cmake ../ \ #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_INCLUDE_PATH=/opt/conda/include/python3.6m \
# -D PYTHON3_LIBRARIES=/opt/conda/lib/python3.6/site-packages \ # -D PYTHON3_LIBRARIES=/opt/conda/lib/python3.6/site-packages \
# -D WITH_GSTREAMER=ON \ # -D WITH_GSTREAMER=ON \
# -D WITH_FFMPEG=ON \ # -D WITH_FFMPEG=OFF \
# && make && make install && ldconfig # && 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 /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 #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

View File

@ -20,7 +20,7 @@ def test(cfg,
model=None): model=None):
# Initialize/load model and set device # Initialize/load model and set device
if model is None: if model is None:
device = torch_utils.select_device() device = torch_utils.select_device(opt.device)
verbose = True verbose = True
# Initialize model # 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('--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('--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('--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() opt = parser.parse_args()
print(opt) print(opt)