NanoOWL docker container dustynv/nanoowl:r36.4.0 gives open cv2 error

Following the tutorial for running nanoOWL at NanoOWL - NVIDIA Jetson AI Lab I have JetPack 6.2.1 on a Jetson Orin Nano (Developer Kit). Running the simplest example like

jetson-containers run --workdir /opt/nanoowl/examples \
  $(autotag nanoowl) \
    python3 owl_predict.py \
      --prompt="[an owl, a glove]" \
      --threshold=0.1 \
      --image_encoder_engine=../data/owl_image_encoder_patch32.engine`

gives me an error:

Traceback (most recent call last):
  File "/opt/nanoowl/examples/owl_predict.py", line 88, in <module>
    image = draw_owl_output(image, output, text=text, draw_text=True)
  File "/opt/nanoowl/nanoowl/owl_drawing.py", line 51, in draw_owl_output
    cv2.rectangle(
cv2.error: OpenCV(4.11.0) :-1: error: (-5:Bad argument) in function 'rectangle'
> Overload resolution failed:
>  - img marked as output argument, but provided NumPy array marked as readonly
>  - img marked as output argument, but provided NumPy array marked as readonly
>  - Expected Ptr<cv::UMat> for argument 'img'
>  - Expected Ptr<cv::UMat> for argument 'img'

The docker image is r36.4.0 is corrct and matches my BSP. Is this an opencv version problem? The image here was pulled from the Nvidia docker registry by jetson-containers

Hi,

img marked as output argument, but provided NumPy array marked as readonly

According to this error, the variable image cannot be used for the output image.
Could you try with another variable?

For example:

 result = draw_owl_output(image, output, text=text, draw_text=True)

Thanks.

Thanks for your reply @AastaLLL

I created issue #45 for this on the nanoowl repo https://github.com/NVIDIA-AI-IOT/nanoowl and created this PR to fix it.
It will be great if the original contributors can review

Hi,

Thanks for the help!
We will check with the repo owner and update with you.

Thanks.