AxisCommunications / acap-computer-vision-sdk-examples

Example applications that provide developers with the tools and knowledge to use Axis Camera Application Platform (ACAP) Computer Vision solution
Apache License 2.0
50 stars 22 forks source link

Open camera feed from from object-detector-python example #156

Closed asimeonovMLPS closed 1 year ago

asimeonovMLPS commented 1 year ago

Hello everyone, we have an AXIS Q1615 Mk III Network Camera and we are getting an error when running one of the examples from object-detector-python. Here are the details of how I run the example.

Values of environment variables: export ARCH=armv7hf export CHIP=tpu

export APP_NAME=acap4-object-detector-python export MODEL_NAME=acap-dl-models

export DEVICE_IP=my-Ip-here export DOCKER_PORT=2375

Command: docker --host tcp://$DEVICE_IP:$DOCKER_PORT compose --env-file ./config/env.$ARCH.$CHIP up

Log: ✔ Container object-detector-python-inference-server-1 Created 0.0s ✔ Container object-detector-python-object-detector-python-1 Created 0.0s ✔ Container object-detector-python-acap_dl-models-1 Created 0.0s Attaching to object-detector-python-acap_dl-models-1, object-detector-python-inference-server-1, object-detector-python-object-detector-python-1 object-detector-python-acap_dl-models-1 | COPYRIGHT object-detector-python-acap_dl-models-1 | coco_labels.txt object-detector-python-acap_dl-models-1 | ssd_mobilenet_v2_coco_quant_postprocess.tflite object-detector-python-acap_dl-models-1 | ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite object-detector-python-acap_dl-models-1 exited with code 0 object-detector-python-object-detector-python-1 | object-detector-python connect to: unix:///tmp/acap-runtime.sock object-detector-python-object-detector-python-1 | Failed to initialize vdo stream object-detector-python-object-detector-python-1 | Traceback (most recent call last): object-detector-python-object-detector-python-1 | File "detector.py", line 136, in object-detector-python-object-detector-python-1 | Detector().run() object-detector-python-object-detector-python-1 | File "detector.py", line 103, in run object-detector-python-object-detector-python-1 | self.run_camera_source() object-detector-python-object-detector-python-1 | File "detector.py", line 114, in run_camera_source object-detector-python-object-detector-python-1 | succeed, bounding_boxes, objclasses, = self.detect(frame) object-detector-python-object-detector-python-1 | File "detector.py", line 39, in detect object-detector-python-object-detector-python-1 | image = image.astype(np.uint8) object-detector-python-object-detector-python-1 | TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' object-detector-python-object-detector-python-1 exited with code 1

There seems to be a problem with opening the camera feed through openCV, when calling cap.read() I get (False, None).

Any help will be highly appreciated.

Thanks in advance.

Corallo commented 1 year ago

Hi @asimeonovMLPS
Can you verify that you have the latest firmware installed (11.5)

asimeonovMLPS commented 1 year ago

Hi @Corallo, thanks for the quick reply. Now I checked and the current version for AXIS OS is 10.12.104.

Corallo commented 1 year ago

It is expected the example not to work anymore with firmware version lower than 11.1 Update the firmware and it should work fine

asimeonovMLPS commented 1 year ago

Thanks @Corallo, I'll try it right away.

asimeonovMLPS commented 1 year ago

Thanks @Corallo, I have now upgraded to version 11.5 and it works great.