Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6392 Discussions

Real time object detection with usb cam ( Raspberry pi 4b + ncs2 )

rnd-amg
Beginner
2,858 Views

Hi Team,

i want test realtime object detection with usb camera and my usb camera already detected

rndamg_0-1657270933824.png

 

but when i run this command " ./object_detection_sample_ssd -m /home/pi/Downloads/build/open_model_zoo/tools/downloader/intel/face-detection-0100/FP16/face-detection-0100.xml -d MYRIAD -i 0 " or " ./object_detection_sample_ssd -m /home/pi/Downloads/build/open_model_zoo/tools/downloader/intel/face-detection-0100/FP16/face-detection-0100.xml -d MYRIAD -i cam "

i got error " [ ERROR ] No suitable images were found " ( capture below )

rndamg_0-1657264362406.png

 

need your advice, Please let me know the workaround to avoid the error.

Regards,

rnd

0 Kudos
23 Replies
Hairul_Intel
Moderator
2,280 Views

Hi rnd,

Thank you for reaching out to us.

 

For your information, the Object Detection SSD C++ Sample only accepts image format as an input. Refer to the Running section of the documentation for further information.

 

 

Regards,

Hairul


0 Kudos
rnd-amg
Beginner
2,269 Views

Hi @Hairul_Intel ,

Thanks for the reply

 

i want test the object by USB camera, can u give me some advice may be some documentation or else how to configure it?

 

regards,

rnd

0 Kudos
Hairul_Intel
Moderator
2,254 Views

Hi rnd,

For your information, you can run Object Detection C++ Demo from Open Model Zoo Demos by using USB Webcam in Raspberry Pi 4 with Intel® Neural Compute Stick 2 (NCS2).

 

I've validated from my end by running the Object Detection C++ Demo with person-detection-retail-0013 model and a Logitech C615 HD Webcam in Raspberry Pi 4.

 

Here is the USB Webcam device details:

2022-07-15-005553_1920x1200_scrot.png

 

Here is the command used to run the demo with USB Webcam:

./object_detection_demo -d MYRIAD -m person-detection-retail-0013/FP16/person-detection-retail-0013.xml -at ssd -i 0

 

Here is the result of the demo using the USB Webcam:

2022-07-15-011351_1920x1200_scrot.png

 

 

Regards,

Hairul

 

0 Kudos
rnd-amg
Beginner
2,230 Views

Hi @Hairul_Intel 

Thanks for the reply

i cant find this " https://docs.openvino.ai/2021.4/omz_demos_object_detection_demo_cpp.html " in my ~/open_model_zoo/demos

 

rndamg_0-1658374179978.png

or i must download it first ?

 

Regards,

rnd

0 Kudos
Hairul_Intel
Moderator
2,214 Views

Hi rnd,

For your information, I've validated the Object Detection C++ Demo using OpenVINO™ Toolkit 2021.4.2 and the demo was cloned from Open Model Zoo 2021.4.2 GitHub repository.

 

To git clone the GitHub repository for Open Model Zoo 2021.4.2, run the following command:

git clone --depth 1 -b 2021.4.2 https://github.com/openvinotoolkit/open_model_zoo.git

 

Run the following command to build the specific Object Detection C++ Demo:

build_demos.sh --target="object_detection_demo"

 

Refer to the Open Model Zoo Demos GitHub repository for further information.

 

 

Regards,

Hairul


0 Kudos
rnd-amg
Beginner
2,206 Views

Hi @Hairul_Intel ,

 

already clone the git, but when i run this commad " build_demos.sh --target="object_detection_demo "

i got message " Unknown option: --target=object_detection_demo "

rndamg_0-1658391347979.png

need your advice, Please let me know the workaround to avoid the error.

Regards,

rnd

0 Kudos
Hairul_Intel
Moderator
2,193 Views

Hi rnd,

As mentioned previously, I've validated the Object Detection C++ Demo using OpenVINO™ Toolkit 2021.4.2 and this demo is available on the GitHub repository of Open Model Zoo 2021.4.2.

 

For clarification purposes, the version of Open Model Zoo must be similar to the version of OpenVINO™ Toolkit. Therefore, you'll need to use OpenVINO™ toolkit version 2021.4.2 to run the Object Detection C++ Demo.

 

Please remove your previous Open Model Zoo directory and ensure you are running the following command:

git clone --depth 1 -b 2021.4.2 https://github.com/openvinotoolkit/open_model_zoo.git

 

 

Regards,

Hairul


0 Kudos
rnd-amg
Beginner
2,185 Views

Hi @Hairul_Intel ,

 

the webcam already working, but i still got error " corrupt JPEG data ", for error details please see at capture below

 

rndamg_0-1658458183034.png

need your advice, Please let me know the workaround to avoid the error.

regards,

rnd

 

0 Kudos
Hairul_Intel
Moderator
2,152 Views

Hi rnd,

For clarification purposes, were you able to produce any output for the Object Detection C++ Demo using your Logitech C270 webcam? If so, do kindly share the entire output with us.

 

On another note, I've found a GitHub thread with similar warning message as yours using the Logitech C270 webcam. Could you please have a try using a different USB webcam (if available) and observe if the warning messages still persists.

 

 

Regards,

Hairul


0 Kudos
rnd-amg
Beginner
2,134 Views

Hi @Hairul_Intel ,

i try using different webcam ( Logitech C920 ) and i got this error

rndamg_1-1658732280241.png

Regards,

rnd

0 Kudos
Hairul_Intel
Moderator
2,092 Views

Hi rnd,

I've replicated this issue and receive the following errors when the NCS2 was disconnected from the USB port while running the Object Detection C++ Demo:

2022-07-27-005756_2560x1440_scrot.png

 

 

Please ensure that the NCS2 is connected securely to the USB port of your Raspberry Pi. If the issue still persists, here are some steps you could try:

  1. Ensure that the NCS2 is listed in the USB devices using lsusb command.
  2. Connect the NCS2 directly to your Raspberry Pi USB 3.0 port instead of a USB hub.
  3. Connect the NCS2 to a powered USB hub.
  4. Disconnect other unnecessary devices from the USB ports.

 

 

Regards,

Hairul

 

0 Kudos
rnd-amg
Beginner
2,085 Views

Hi @Hairul_Intel ,

 

i think it's because i used extension cable for NCS2 

any similars models that already stable & already have a report like counting each object ( vehicle, person )and the object capture by cctv ( rtsp ) and webcam ?

because i want counting vehicle & person at red light intersection

regards,

rnd

0 Kudos
Hairul_Intel
Moderator
2,047 Views

Hi rnd,

For your information, Open Model Zoo Demos does provide plenty of demos which you can refer to according to your needs.

 

For example, you can refer to the Pedestrian Tracker C++ Demo and its code as reference for your project as it does provide tracking and counting of detections.

 

However, the demo is not supported for NCS2 as the required person-reidentification models are not supported on MYRIAD devices as mentioned here.

 

Do note that the only supported models for Pedestrian Tracker C++ Demo are as follows:

  • person-detection-retail-0002
  • person-detection-retail-0013
  • person-reidentification-retail-0277
  • person-reidentification-retail-0286
  • person-reidentification-retail-0287
  • person-reidentification-retail-0288

 

 

For vehicle detection, you can refer to the Object Detection C++ Demo for your project and the demo does provide support for the following Intel’s Pre-Trained vehicle detection models:

  • vehicle-detection-0200
  • vehicle-detection-0201
  • vehicle-detection-0202
  • vehicle-detection-adas-0002

 

 

 

Regards,

Hairul


0 Kudos
rnd-amg
Beginner
2,037 Views

Hi @Hairul_Intel 

 

this models https://docs.openvino.ai/2021.4/omz_demos_pedestrian_tracker_demo_cpp.html support RTSP in raspberry pi4 + NCS2 ?

or any models that support RTSP in raspberry pi4 + NCS2 ?

or this models " pedestrian-and-vehicle-detector-adas-0001 " support RTSP in raspberry pi4 + NCS2?

 

need your advice

Regards,

rnd

0 Kudos
Hairul_Intel
Moderator
1,970 Views

Hi rnd,

As mentioned previously, the Pedestrian Tracker C++ Demo is not supported for NCS2 as the required person-reidentification models are not supported on MYRIAD devices as mentioned here.

 

On another note, I've validated the Object Detection C++ Demo using pedestrian-and-vehicle-detector-adas-0001 model with IP camera. For your information, I am using IP Webcam with RTSP protocol when running the demo.

 

Here is the command I used to run the demo with RTSP:

./object_detection_demo -d MYRIAD -m pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.xml -at ssd -i rtsp://username:password@ip_address:port/h264_ulaw.sdp

 

Here is the result for running the demo with RTSP input:

edit_rtsp.png

 

 

Please note that RTSP is expected to have latency issues on OpenCV. To help minimize this latency issue, you can set your RTSP data rate to a higher value, and also reduce your IP camera resolution.

 

 

 

Regards,

Hairul

 

0 Kudos
rnd-amg
Beginner
1,966 Views

Hi @Hairul_Intel 

i've got error when run this the command " ./object_detection_demo -d MYRIAD -m /home/pi/open_model_zoo/tools/downloader/intel/pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.xml -at ssd -d MYRIAD -i rtsp://username:password@ip_address:port/stream1 "

my url rtsp is " rtsp://username:password@ip_address:port/stream1 "

 

rndamg_0-1659089117513.png

need your advice, Please let me know the workaround to avoid the error.

Regards,

rnd

0 Kudos
rnd-amg
Beginner
1,875 Views

Hi @Hairul_Intel ,

already can run the models, but i must set the resolution higher then normally ( 1080P ) ( capture below )

rndamg_0-1659349769747.png

my questions :

1.  how i can resize the output frame ? because i can't minimize/rezise it manually

2. the models running just for a few munites, how if i want running it for 24x7?

 

Regards,

rnd

0 Kudos
Hairul_Intel
Moderator
1,846 Views

Hi rnd,

To answer your first question, you can specify the maximum output window resolution of the demo by using the -output_resolution (width)x(height) command. Refer to the Object Detection C++ Demo for more information.

 

Here is an example code for running the -output_resolution command:

./object_detection_demo -d MYRIAD -m pedestrian-and-vehicle-detector-adas-0001/FP16/pedestrian-and-vehicle-detector-adas-0001.xml -at ssd -i rtsp://username:password@ip_address:port/h264_ulaw.sdp -output_resolution 720x240

 

Regarding your second question, we are checking with the relevant team and we'll update you once we get feedback from them.

 

 

Regards,

Hairul


0 Kudos
rnd-amg
Beginner
1,824 Views

Hi @Hairul_Intel ,

Regarding my second question about the models running just for few minutes, this is the error ( capture below )

rndamg_0-1659492431419.png

may be can help u to investigate the issue

Regards,

rnd

0 Kudos
Hairul_Intel
Moderator
1,804 Views

Hi rnd,

Regarding your second question on running the Object Detection C++ Demo for 24/7 using RTSP input, there is a known issue of RTSP streams freezing similar to what was discussed in this GitHub thread.

 

There are a lot of factors for causing RTSP stream failure such as bandwidth issues, connection issues, reboot from the stream source, insufficient computational power, memory issues and especially programming library issues.

 

Moreover, it is known that IP cameras can behave erratically, such as closing streams unexpectedly or reboot.

 

For a successful inferencing, a constant uninterrupted input (images or video) is necessary and a simple USB Webcam would suffice.

 

To help remedy this issue, here are some of our suggestions:

  1. Switch over to direct connection with a USB Webcam instead of RTSP input.
  2. Use a more powerful device for your inferencing (i.e. CPU or GPU plugin).

 

 

On another note, the error message you shared happens when the USB3 protocol was unable to complete the method call (which may happen due to RTSP input freezing).

 

However, the demo prompt shows "[INFO] The execution has completed successfully" which means it has completed inferencing. As long as the inferencing can be done, you can take these error messages as warnings.

 

 

Regards,

Hairul

 


0 Kudos
Reply