nnstreamer / nnstreamer-example

Example applications of nnstreamer. Note that we have to enable the 'apptest" CI module in the near future.
GNU Lesser General Public License v2.1
77 stars 72 forks source link

[native] Add object detection example using 2 cameras #179

Closed tony-jinwoo-ahn closed 3 years ago

tony-jinwoo-ahn commented 4 years ago

Add object detection example using 2 cameras with tflite.

Sender:

Raspberry Pi 4, Ubuntu Server 18.04 arm64 2 USB cameras (720p, 30fps) It streams videos with 2 cameras to 2 different network ports.

Receiver:

Ubuntu Desktop 18.04 It gets video streams from 2 network ports and detects objects.

Usage:

$ ./nnstreamer_example_object_detection_tflite_2cam sender IP PORT1 /dev/video0 PORT2 /dev/video1 $ ./nnstreamer_example_object_detection_tflite_2cam receiver IP PORT1 PORT2

Related issue

Resolves: https://github.com/nnstreamer/nnstreamer-example/issues/163

Self evaluation:

  1. Build test: [*]Passed [ ]Failed [ ]Skipped
  2. Run test: [*]Passed [ ]Failed [ ]Skipped

How to evaluate:

  1. sender: Attach 2 USB cameras on RPI4. Check dmesg for correct /dev/videoN node. $ ./nnstreamer_example_object_detection_tflite_2cam sender IP PORT1 /dev/video0 PORT2 /dev/video1
  2. receiver: Make sure your PC is connected with same Wi-Fi with your Rpi device. $ ./nnstreamer_example_object_detection_tflite_2cam receiver IP PORT1 PORT2
taos-ci commented 4 years ago

:memo: Version: 1.20190225. Thank you for submitting PR #179. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://nnsuite.mooo.com/.

taos-ci commented 4 years ago

:octocat: cibot: @tony-jinwoo-ahn, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://nnsuite.mooo.com/nnstreamer-example/ci/repo-workers/pr-checker/179-202009131833110.91383194923401-6d241ed6d2efc9348c9b78d2cc92ebec2ec29087/.

taos-ci commented 4 years ago

:octocat: cibot: @tony-jinwoo-ahn, One of the format checkers is failed. If you want to get a hint to fix this issue, please go to https://github.com/nnstreamer/nnstreamer-example/wiki/.

taos-ci commented 4 years ago

:octocat: cibot: @tony-jinwoo-ahn, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://nnsuite.mooo.com/nnstreamer-example/ci/repo-workers/pr-checker/179-202009142031220.72911190986633-efc21a8d0fef3c6a280c581a62d6d1acedfbef66/.

tony-jinwoo-ahn commented 3 years ago

@wooksong < Thank you for review!

taos-ci commented 3 years ago

:octocat: cibot: @tony-jinwoo-ahn, One of the format checkers is failed. If you want to get a hint to fix this issue, please go to https://github.com/nnstreamer/nnstreamer-example/wiki/.

taos-ci commented 3 years ago

:octocat: cibot: @tony-jinwoo-ahn, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://nnsuite.mooo.com/nnstreamer-example/ci/repo-workers/pr-checker/179-202011200954510.46855807304382-83ca4bc8fedbb54ec6d8b5a323494a07d711c810/.

taos-ci commented 3 years ago

:octocat: cibot: @tony-jinwoo-ahn, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://nnsuite.mooo.com/nnstreamer-example/ci/repo-workers/pr-checker/179-202011200956470.090974092483521-d811ca8f43b7fd6a76f229679ad7dd575284ee5b/.

taos-ci commented 3 years ago

:octocat: cibot: @tony-jinwoo-ahn, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://nnsuite.mooo.com/nnstreamer-example/ci/repo-workers/pr-checker/179-202011201007090.50908088684082-ffbe62cc9103aa63aab19c8c6b1d74d7005f0fe9/.

taos-ci commented 3 years ago

:octocat: cibot: @tony-jinwoo-ahn, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://nnsuite.mooo.com/nnstreamer-example/ci/repo-workers/pr-checker/179-202011201032390.98884892463684-a454562ad8edee006bfc515d0171704420af8603/.

myungjoo commented 3 years ago

The CI system says your C++ code has glitches (potentially using uninitialized values):

[   42s] ../native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc: In function 'int main(int, char**)':
[   42s] ../native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc:829:7: error: 'dev_video2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   42s]   828 |       g_strdup_printf
[   42s]       |       ~~~~~~~~~~~~~~~
[   42s]   829 |       ("v4l2src name=src device=%s ! videoconvert ! videoscale ! "
[   42s]       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   830 |        "video/x-raw,width=%d,height=%d,format=RGB ! "
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   831 |        "jpegenc ! tcpserversink host=%s port=%d",
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   832 |        dev_video2, VIDEO_WIDTH/2, VIDEO_HEIGHT/2, host, port2);
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s] ../native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc:822:7: error: 'dev_video1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   42s]   821 |       g_strdup_printf
[   42s]       |       ~~~~~~~~~~~~~~~
[   42s]   822 |       ("v4l2src name=src device=%s ! videoconvert ! videoscale ! "
[   42s]       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   823 |        "video/x-raw,width=%d,height=%d,format=RGB ! "
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   824 |        "jpegenc ! tcpserversink host=%s port=%d",
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   825 |        dev_video1, VIDEO_WIDTH/2, VIDEO_HEIGHT/2, host, port1);
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s] cc1plus: all warnings being treated as errors
[   42s] [27/28] Linking target native/example_object_detection_tensorflow_lite/nnstreamer_example_object_detection_tflite
tony-jinwoo-ahn commented 3 years ago

The CI system says your C++ code has glitches (potentially using uninitialized values):

[   42s] ../native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc: In function 'int main(int, char**)':
[   42s] ../native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc:829:7: error: 'dev_video2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   42s]   828 |       g_strdup_printf
[   42s]       |       ~~~~~~~~~~~~~~~
[   42s]   829 |       ("v4l2src name=src device=%s ! videoconvert ! videoscale ! "
[   42s]       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   830 |        "video/x-raw,width=%d,height=%d,format=RGB ! "
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   831 |        "jpegenc ! tcpserversink host=%s port=%d",
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   832 |        dev_video2, VIDEO_WIDTH/2, VIDEO_HEIGHT/2, host, port2);
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s] ../native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc:822:7: error: 'dev_video1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   42s]   821 |       g_strdup_printf
[   42s]       |       ~~~~~~~~~~~~~~~
[   42s]   822 |       ("v4l2src name=src device=%s ! videoconvert ! videoscale ! "
[   42s]       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   823 |        "video/x-raw,width=%d,height=%d,format=RGB ! "
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   824 |        "jpegenc ! tcpserversink host=%s port=%d",
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s]   825 |        dev_video1, VIDEO_WIDTH/2, VIDEO_HEIGHT/2, host, port1);
[   42s]       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   42s] cc1plus: all warnings being treated as errors
[   42s] [27/28] Linking target native/example_object_detection_tensorflow_lite/nnstreamer_example_object_detection_tflite

Thank you, I'll check it.

myungjoo commented 3 years ago

@anyj0527 Add this to README.md when you have some spare time :)

tony-jinwoo-ahn commented 3 years ago

Thank you, I'd close related issue.

tony-jinwoo-ahn commented 3 years ago

@anyj0527 Add this to README.md when you have some spare time :)

I can do this.

tony-jinwoo-ahn commented 3 years ago

I'd add this to README.md in this weekend. :)

tony-jinwoo-ahn commented 3 years ago

done: https://github.com/nnstreamer/nnstreamer-example/pull/241