Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object detection example fails (Caffe with support for Faster-RCNN) #142

Closed
szekany opened this issue Feb 1, 2018 · 27 comments
Closed

Object detection example fails (Caffe with support for Faster-RCNN) #142

szekany opened this issue Feb 1, 2018 · 27 comments

Comments

@szekany
Copy link

szekany commented Feb 1, 2018

Hi, I'm running into an issue with Scanner's integration with Caffe for object detection. I'm trying to run the example in "examples/apps/object_detection/main.py" on a fresh install of Scanner, and it fails with the following output:

[libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 483:21: Message type "caffe.LayerParameter" has no field named "roi_pooling_param".

After looking into this, it appears that the Intel version of Caffe (which you get if you build Scanner without GPU) supports Faster-RCNN out of the box, while the BVLC version does not. When I build Scanner without GPU support, the object-detection example doesn't run at all.

I've tried a few different workarounds:

  • Building the (now deprecated) py-faster-rcnn version of Caffe. This fails because the CUDA compiler interface has changed since this repo was last updated in early 2016.
  • Pulling the roi_pooling_layer files from Intel's version of Caffe and following the instructions to add a layer to BVLC Caffe. This seemed like it should work, but I was unable to get it to compile due to errors with undeclared variables.
  • Doing a merge of the latest version of BLVC Caffe with py-faster-rcnn. This actually compiled, but still fails with an unhelpful error ("terminate called after throwing an instance of 'boost::python::error_already_set'"). I'm still troubleshooting this, but I'm having difficulty just figuring out where this exception is getting thrown from.

The "right" answer here might be to integrate Scanner with Detectron, but I'm hoping for an easier solution that just to get started. Anyone else run into this or have any ideas?

@szekany szekany changed the title Object detection / Caffe integration for Faster-RCNN Object detection example fails (Caffe with support for Faster-RCNN) Feb 1, 2018
@fpoms
Copy link
Contributor

fpoms commented Feb 2, 2018

(I pushed a few commits to tidy up the object detection app, so I'd pull those before following below.)

Getting py-faster-rcnn to work is usually pretty finicky.

In the past, I've had success with your option 3 by following these steps.

  1. IMPORTANT: I removed any trace of the Caffe that Scanner installs in thirdparty/install to avoid mixing dependencies or header files. If a Caffe install picks up on any other Caffe headers, it can cause random segfaults when executing. Specifically, remove thirdparty/install/include/caffe and thirdparty/install/lib/libcaffe*.
  2. I followed support 1080P and cudnn v5? rbgirshick/py-faster-rcnn#237 to install a version of caffe that's compatible with py-faster-rcnn. When building caffe, I made sure to link against the libraries Scanner builds in thirdparty/install.
    3.I rebuilt Scanner using the new Caffe by pointing CMake at the new installation and then reinstalled the Scanner python lib. Build with -DBUILD_OPENPOSE_OPS=OFF to avoid including other versions of Caffe.
  3. Next, I went through the installation procedure for py-faster-rcnn, in particular step 3 which builds the cython modules in the py-faster-rcnn lib folder.
  4. Then I added the new Caffe installation's python folder AND the <py_faster_rcnn_root>/lib directory to my PYTHONPATH.

Hopefully this should get you up and running with faster-rcnn. This is obviously an annoying process (due largely to the incompatibility of multiple Caffe versions) so I agree that we need to migrate to a more modern detection framework, such as Detectron or the TensorFlow object detection API.

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Thanks for the response! I've followed your instructions to try to make this work, but Scanner is now segfaulting almost immediately when running the object detection example. I compiled with debug symbols, ran GDB, and managed to get at least a partial stack trace:

  0%|                                                                 | 0/101 [00:02<?, ?it/s, workers=1, tasks=101, jobs=1]
Thread 123 "python" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff3126c700 (LWP 5723)]
__memmove_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:146
146	../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: No such file or directory.
(gdb) backtrace
#0  __memmove_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:146
#1  0x00007fff78de3fdd in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#2  0x00007fff78cefba5 in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#3  0x00007fff78cefd43 in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#4  0x00007fff78e47c30 in cuLaunchKernel () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#5  0x00007fff4a5b99aa in halide_cuda_run () from /home/szekany/.local/lib/python2.7/site-packages/scannerpy/libstdlib.so
#6  0x00007fff4a5bad78 in __caffe_input_transformer_gpu ()
   from /home/szekany/.local/lib/python2.7/site-packages/scannerpy/libstdlib.so
#7  0x00007fff00000008 in ?? ()
#8  0x0000000100000001 in ?? ()
#9  0x0000000000000000 in ?? ()

It appears that the caffe_input_transformer_gpu function, which then calls Halide, is involved. Unfortunately I don't know anything about Halide, so I can't troubleshoot further.

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

If you change the device type being used for the 'CaffeInput' operation to CPU from GPU, that should resolve the issue. We have noticed issues with GPU halide in the past.

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

I pushed a few commits which make that modification for you, so if you pull the most recent code, the example should work!

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Thanks! That fixed the problem with Halide. The object-detection example now gets through ingesting the video and crashes due to an issue with ffmpeg:

szekany@szekany-desktop:~/scanner$ python examples/apps/object_detection/main.py 
[youtube] 79DijItQXMM: Downloading webpage
[youtube] 79DijItQXMM: Downloading video info webpage
[youtube] 79DijItQXMM: Extracting video information
WARNING: "id" field is not a string - forcing string conversion, there is an error in extractor
[download] Destination: /tmp/example.mp4
[download] 100% of 9.22MiB in 01:08
Ingesting video into Scanner ...
100%|██████████████████████████████████| 101/101 [07:09<00:00,  5.04s/it, workers=1, tasks=0, jobs=1]
Extracting frames...
Writing output video...
(360, 640, 3)
[libx264 @ 0x35e43c0] [IMGUTILS @ 0x7ffd24bcb6c0] Picture size 4294967295x0 is invalid
[libx264 @ 0x35e43c0] [IMGUTILS @ 0x7ffd24bcb690] Picture size 0x0 is invalid
[libx264 @ 0x35e43c0] The encoder timebase is not set.
Segmentation fault (core dumped)

I haven't had time to fully troubleshoot this one yet, but it looks like ffmpeg might just be getting passed incorrect parameters somewhere. If you have any ideas about what's going wrong, that would be great!

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

Could you run which ffmpeg and ffmpeg -version and paste the results here?

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Sure:

szekany@szekany-System-Product-Name:~/scanner$ which ffmpeg
/home/szekany/scanner/thirdparty/install/bin/ffmpeg
szekany@szekany-System-Product-Name:~/scanner$ ffmpeg -version
ffmpeg version n3.3.1-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
configuration: --prefix=/home/szekany/scanner/thirdparty/install --extra-version=0ubuntu0.16.04.1 --toolchain=hardened --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libschroedinger --enable-avresample --enable-libx264 --enable-nonfree
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

This seems like an issue with OpenCV (which is being used to encode the video here). Can you run echo $PYTHONPATH and show me what that returns?

@szekany
Copy link
Author

szekany commented Feb 5, 2018

I agree, it seems like an issue with OpenCV. I'm looking into the cvCreateVideoWriter_FFMPEG functions to see if anything looks obviously broken (like incorrect parameters being passed to FFmpeg), but it's slow going since I don't really know either code base.

Anyway, here's my $PYTHONPATH:
/home/szekany/scanner/thirdparty/build/opencv/build/lib:/home/szekany/scanner/thirdparty/install/lib:/home/szekany/scanner/thirdparty/install/python:/home/szekany/scanner/lib:/home/szekany/scanner/thirdparty/install/lib/python2.7/dist-packages

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

Do you have a native installation of OpenCV outside of the one in the scanner thirdparty directory?

Additionally, you should point your PYTHONPATH at scanner/thirdparty/install/lib/python2.7/site-packages if you wanted to use the scanner OpenCV install (you seem to be pointing it to build/opencv/build/lib currently).

@szekany
Copy link
Author

szekany commented Feb 5, 2018

I don't think I have another OpenCV install (it's a relatively fresh installation of Ubuntu 16.04), but I'll check. Thanks for pointing out the discrepancy with my path, I'll fix that and see if it makes a difference.

@szekany
Copy link
Author

szekany commented Feb 5, 2018

OK, there were a few older OpenCV libraries hanging around for some reason. So I've deleted those, and PYTHONPATH is now:

/home/szekany/scanner/thirdparty/install/lib:/home/szekany/scanner/thirdparty/install/python:/home/szekany/scanner/lib:/home/szekany/scanner/thirdparty/install/lib/python2.7/dist-packages:/home/szekany/scanner/thirdparty/install/lib/python2.7/dist-packages

Unfortunately I still get the same error.

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

It should actually be /home/szekany/scanner/thirdparty/install/lib/python2.7/site-packages, not dist-packages

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Hmm... I don't have a site-packages directory for some reason... Any idea how that gets created?

@szekany
Copy link
Author

szekany commented Feb 5, 2018

FWIW, I do have ~/.local/lib/python2.7/site-packages, which is where scanner and scannerpy are installed.

Sorry if I am a bit naive, I don't do much python development...

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

No worries, it seems like there is no consensus on whether it should be named dist-packages or site-packages. Is there a cv2.so in /home/szekany/scanner/thirdparty/install/lib/python2.7/dist-packages?

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Yep

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

Can you insert some print statements in object_detection/main.py and then show me the output?

Specifically...

L82: Insert print(output.isOpened()) and print(frame.shape)

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

Just edited the above comment with the print statements

@szekany
Copy link
Author

szekany commented Feb 5, 2018

OK, I've got:

for (frame, bboxes) in zip(video_frames, video_bboxes): 
        print(output.isOpened())
        print(frame.shape)
        for bbox in bboxes:
            cv2.rectangle(

But I don't get any additional output when running: it looks like the script doesn't even get that far.

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

Can you place a print right after initializing the VideoWriter to see if it's getting past that line?

If it isn't, it might be that the h264 encoder isn't working. You could try changing *'X264' to *'MJPG' to see if a different video encoder might work.

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Huh, so it looks like it is not getting past the VideoWriter line.

When I change the encoder type to MJPG, I get an error that library doesn't exist:

[mjpeg @ 0x2c75100] The encoder timebase is not set.
Could not open codec 'mjpeg': Unspecified error
False
(360, 640, 3)
...

I'm wondering now if this is an ffmpeg/Ubuntu problem: maybe my h264 encoder isn't configured properly.

@fpoms
Copy link
Contributor

fpoms commented Feb 5, 2018

Can you show me the output of ldd /home/szekany/scanner/thirdparty/install/lib/python2.7/dist-packages/cv2.so?

@szekany
Copy link
Author

szekany commented Feb 5, 2018

Sure, here you go:

szekany@szekany-desktop:~/scanner$ ldd /home/szekany/scanner/thirdparty/install/lib/python2.7/dist-packages/cv2.so
	linux-vdso.so.1 =>  (0x00007fff7c088000)
	libopencv_hdf.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_hdf.so.3.2 (0x00007f7f6c4c8000)
	libopencv_freetype.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_freetype.so.3.2 (0x00007f7f6c1a4000)
	libopencv_fuzzy.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_fuzzy.so.3.2 (0x00007f7f6bf96000)
	libopencv_xphoto.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_xphoto.so.3.2 (0x00007f7f6bd58000)
	libopencv_bgsegm.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_bgsegm.so.3.2 (0x00007f7f6bb49000)
	libopencv_bioinspired.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_bioinspired.so.3.2 (0x00007f7f6b912000)
	libopencv_saliency.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_saliency.so.3.2 (0x00007f7f6b6e1000)
	libopencv_ccalib.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_ccalib.so.3.2 (0x00007f7f6b471000)
	libopencv_tracking.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_tracking.so.3.2 (0x00007f7f6af27000)
	libopencv_aruco.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_aruco.so.3.2 (0x00007f7f6acd6000)
	libopencv_optflow.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_optflow.so.3.2 (0x00007f7f6aa75000)
	libopencv_sfm.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_sfm.so.3.2 (0x00007f7f6a4fd000)
	libopencv_stitching.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_stitching.so.3.2 (0x00007f7f6a24b000)
	libopencv_dnn.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_dnn.so.3.2 (0x00007f7f69c52000)
	libopencv_plot.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_plot.so.3.2 (0x00007f7f69a47000)
	libopencv_face.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_face.so.3.2 (0x00007f7f6981a000)
	libopencv_text.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_text.so.3.2 (0x00007f7f694f8000)
	libopencv_photo.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_photo.so.3.2 (0x00007f7f690d5000)
	libopencv_ximgproc.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_ximgproc.so.3.2 (0x00007f7f68cb9000)
	libopencv_objdetect.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_objdetect.so.3.2 (0x00007f7f68a50000)
	libopencv_xfeatures2d.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_xfeatures2d.so.3.2 (0x00007f7f68507000)
	libopencv_shape.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_shape.so.3.2 (0x00007f7f682ca000)
	libopencv_video.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_video.so.3.2 (0x00007f7f67f3d000)
	libopencv_calib3d.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_calib3d.so.3.2 (0x00007f7f67bb4000)
	libopencv_features2d.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_features2d.so.3.2 (0x00007f7f678e8000)
	libopencv_flann.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_flann.so.3.2 (0x00007f7f6768c000)
	libopencv_ml.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_ml.so.3.2 (0x00007f7f673bd000)
	libopencv_highgui.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_highgui.so.3.2 (0x00007f7f671b0000)
	libopencv_videoio.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_videoio.so.3.2 (0x00007f7f66f80000)
	libopencv_imgcodecs.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_imgcodecs.so.3.2 (0x00007f7f66a86000)
	libopencv_imgproc.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_imgproc.so.3.2 (0x00007f7f65224000)
	libopencv_core.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_core.so.3.2 (0x00007f7f63d3d000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7f639bb000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7f637a5000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7f633db000)
	libhdf5_serial.so.10 => /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10 (0x00007f7f62f3e000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7f62c35000)
	libglog.so.0 => /usr/lib/x86_64-linux-gnu/libglog.so.0 (0x00007f7f62a06000)
	libgflags.so.2 => /usr/lib/x86_64-linux-gnu/libgflags.so.2 (0x00007f7f627e5000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7f625c8000)
	libcholmod.so.3.0.6 => /usr/lib/x86_64-linux-gnu/libcholmod.so.3.0.6 (0x00007f7f622f4000)
	liblapack.so.3 => /usr/lib/liblapack.so.3 (0x00007f7f61b11000)
	libf77blas.so.3 => /usr/lib/libf77blas.so.3 (0x00007f7f618f1000)
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f7f616cf000)
	libopencv_cudafeatures2d.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_cudafeatures2d.so.3.2 (0x00007f7f5fad2000)
	libopencv_cudalegacy.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_cudalegacy.so.3.2 (0x00007f7f5f18f000)
	libcudart.so.8.0 => /usr/local/cuda/lib64/libcudart.so.8.0 (0x00007f7f5ef29000)
	libopencv_cudawarping.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_cudawarping.so.3.2 (0x00007f7f5c332000)
	libopencv_cudaarithm.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_cudaarithm.so.3.2 (0x00007f7f53dbe000)
	libopenblas.so.0 => /usr/lib/libopenblas.so.0 (0x00007f7f51d2a000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7f6cc08000)
	libopencv_cudaimgproc.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_cudaimgproc.so.3.2 (0x00007f7f50425000)
	libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f7f4fdda000)
	libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f7f4fb25000)
	libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f7f4f811000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f7f4f5ef000)
	libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f7f4f39c000)
	libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f7f4f08b000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7f4ee83000)
	libavcodec.so.57 => /home/szekany/scanner/thirdparty/install/lib/libavcodec.so.57 (0x00007f7f4d794000)
	libavformat.so.57 => /home/szekany/scanner/thirdparty/install/lib/libavformat.so.57 (0x00007f7f4d35a000)
	libavutil.so.55 => /home/szekany/scanner/thirdparty/install/lib/libavutil.so.55 (0x00007f7f4d0d4000)
	libswscale.so.4 => /home/szekany/scanner/thirdparty/install/lib/libswscale.so.4 (0x00007f7f4ce45000)
	libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f7f4cbec000)
	libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f7f4c9c7000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7f4c7ad000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7f4c5a9000)
	libsz.so.2 => /usr/lib/x86_64-linux-gnu/libsz.so.2 (0x00007f7f4c3a6000)
	libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f7f4c18b000)
	libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f7f4bf2a000)
	libamd.so.2.4.1 => /usr/lib/x86_64-linux-gnu/libamd.so.2.4.1 (0x00007f7f4bd21000)
	libcolamd.so.2.9.1 => /usr/lib/x86_64-linux-gnu/libcolamd.so.2.9.1 (0x00007f7f4bb1a000)
	libcamd.so.2.4.1 => /usr/lib/x86_64-linux-gnu/libcamd.so.2.4.1 (0x00007f7f4b910000)
	libccolamd.so.2.9.1 => /usr/lib/x86_64-linux-gnu/libccolamd.so.2.9.1 (0x00007f7f4b705000)
	libsuitesparseconfig.so.4.4.6 => /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so.4.4.6 (0x00007f7f4b502000)
	libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f7f4b1d7000)
	libcblas.so.3 => /usr/lib/libcblas.so.3 (0x00007f7f4afb5000)
	libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007f7f4aa17000)
	libopencv_cudafilters.so.3.2 => /home/szekany/scanner/thirdparty/install/lib/libopencv_cudafilters.so.3.2 (0x00007f7f3340f000)
	libnppc.so.8.0 => /usr/local/cuda/lib64/libnppc.so.8.0 (0x00007f7f3319f000)
	libnppi.so.8.0 => /usr/local/cuda/lib64/libnppi.so.8.0 (0x00007f7f2c77b000)
	libcublas.so.8.0 => /usr/local/cuda/lib64/libcublas.so.8.0 (0x00007f7f29ce3000)
	libcufft.so.8.0 => /usr/local/cuda/lib64/libcufft.so.8.0 (0x00007f7f20e94000)
	libnpps.so.8.0 => /usr/local/cuda/lib64/libnpps.so.8.0 (0x00007f7f2049e000)
	libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f7f2029a000)
	libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f7f2008d000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f7f1fd53000)
	libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f7f1fb4d000)
	libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f7f1f928000)
	libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f7f1f5a0000)
	libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f7f1f38a000)
	libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f7f1f13e000)
	libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f7f1eefb000)
	libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f7f1ecf1000)
	libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f7f1eaee000)
	libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f7f1e8de000)
	libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f7f1e6d3000)
	libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f7f1e4c9000)
	libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f7f1e2c6000)
	libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f7f1e0c3000)
	libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f7f1deb1000)
	libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f7f1dc09000)
	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f7f1d95f000)
	libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f7f1d75b000)
	libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f7f1d551000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f7f1d32f000)
	libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f7f1d127000)
	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f7f1ceb7000)
	libswresample.so.2 => /home/szekany/scanner/thirdparty/install/lib/libswresample.so.2 (0x00007f7f1cc99000)
	libva.so.1 => /usr/lib/x86_64-linux-gnu/libva.so.1 (0x00007f7f1ca7d000)
	libx264.so.148 => /usr/lib/x86_64-linux-gnu/libx264.so.148 (0x00007f7f1c6d9000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f7f1c4b7000)
	libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f7f1c2a7000)
	libvdpau.so.1 => /usr/lib/x86_64-linux-gnu/libvdpau.so.1 (0x00007f7f1c0a3000)
	libva-x11.so.1 => /usr/lib/x86_64-linux-gnu/libva-x11.so.1 (0x00007f7f1be9d000)
	libva-drm.so.1 => /usr/lib/x86_64-linux-gnu/libva-drm.so.1 (0x00007f7f1bc9a000)
	libaec.so.0 => /usr/lib/x86_64-linux-gnu/libaec.so.0 (0x00007f7f1ba92000)
	libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f7f1b853000)
	libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f7f1b631000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f7f1b416000)
	libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f7f1b1b8000)
	libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f7f1afaf000)
	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f7f1ad86000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f7f1ab82000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f7f1a97c000)
	libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f7f1a76b000)
	libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f7f1a545000)
	libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f7f1a33d000)

@szekany
Copy link
Author

szekany commented Feb 6, 2018

Well... after playing around with it for a bit, I discovered that the output file extension seems to make a difference. Reading online it sounds like the video encoder situation is different depending on your OS, and that some of the defaults in Ubuntu are broken.

So all I did was change to the MJPG encoder with a .avi extension, and the object-detection example runs to completion:

    output = cv2.VideoWriter(
        'example_detections.avi',
        cv2.VideoWriter_fourcc('M','J','P','G'),

Thank you so much for the help!

@szekany szekany closed this as completed Feb 6, 2018
@fpoms
Copy link
Contributor

fpoms commented Feb 6, 2018

Ah, I think I've run into that issue a long time ago! Glad it was resolved.

If you end up writing something in Scanner, would love to hear what it was and what your experience of the system is!

@szekany
Copy link
Author

szekany commented Feb 6, 2018

Thanks, I'll keep you posted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants