Having trouble running NPU Demo


I am running a VIM3 Pro using Ubuntu XFCE Build:20191231

When I follow the guide located at NPU Demo and source code

Everything is fine until I try to run it (via USB camera). My camera is video0. I get the following output.

root@Khadas:~/aml_npu_demo_binaries/detect_demo# ./detect_demo_uvc /dev/video0 1 > /dev/null
W Detect_api:[det_set_log_level:19]Set log level=1
W Detect_api:[det_set_log_level:21]output_format not support Imperfect, default to DET_LOG_TERMINAL
W Detect_api:[det_set_log_level:26]Not exist VSI_NN_LOG_LEVEL, Setenv set_vsi_log_error_level
(detect_demo_uvc:7005): GStreamer-CRITICAL **: 01:09:25.332: gst_element_get_state: assertion ‘GST_IS_ELEMENT (element)’ failed

Am I missing something? My camera is a Logitech C270. Programs like guvcview can use the camera fine. I have also made sure the programs are not in use incase there is some kind of device lock.

GStreamer-CRITICAL **: 01:09:25.332: gst_element_get_state: assertion ‘GST_IS_ELEMENT (element)’ failed

Seems to indicate the camera may not be compatible. If that is the case may there be a workaround?

@Solaris Switch to FB mode and try again.

Hello @Frank

Thanks for getting back to me.

I have attempted this in FB mode as well. It gave a little bit more output. Sorry I dont have my TTY device with me so I could not get a print out. I had to take a picture.

It seems thats quite blurry. Give me a moment. EDIT:: That should be a little better.

@Solaris I will try it . I’ll tell you the result later.

1 Like

Not a problem, please take your time.

This is the print out of ls /dev my camera is video0 checked before and after. To verify it was correct.


@Solaris I try it later .It work fine.

I use it in FB mode . This is my steps. you can try with it .

1. sudo -i 
2. git clone https://gitlab.com/khadas/aml_npu_demo_binaries
3. cd aml_npu_demo_binaries/detect_demo
5. ./detect_demo_uvc /dev/video0 1
1 Like

Much better results.

It looks like the capture is still failing. However, it looks like it is because it is attempting 1920x1080. This camera only support 720p. Can this configuration be changed?

EDIT:: This may be an issue with my 270 and openCV.

@Solaris You can download the source code form gitlab , and modeifed it to yourself

Thanks @Frank I will probably pickup a different camera. This seems to be more of an issue with the C270 and openCV.

@Solaris OpenCV was installed in our board . You don’t need to check it . I think you camera manbe has adaptation problems .

Agreed. Thank you for your help.

@Frank @Solaris I have the same problem. Can you share the solution?