• Community
  • Pedestrian-Reidentifications crashes quickly

Hi,

I got my OAK-1 and OAK-D today and started testing. I'm getting an issue with the pedestrian-reidentification demo through in that within about 5 - 60 seconds of it starting it always crashes with the following:

Traceback (most recent call last):
  File "main.py", line 132, in <module>
    nn_data.setLayer("data", to_planar(det_frame, (48, 96)))
  File "main.py", line 28, in to_planar
    return [val for channel in cv2.resize(arr, shape).transpose(2, 0, 1) for y_col in channel for val in y_col]
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4045: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

Any ideas?

Thanks!

    Hi Thingymagig ,

    This one is new in terms of demos, so I suspect we have a bug. Thanks for the report on it.

    What OS/computer are you running this on? We have a slew so we'll try reproducing on that device. (Often these can be quite host-specific crashes, depending on host speed, libraries, etc.)

    Thanks,
    Brandon

      Brandon

      Hi,

      Took me a few days to get back to my computer for this.

      I'm running Windows 10 Pro N on an AMD Ryzen 7 3700X with 32GB of RAM using git bash for my shell (as powershell really sucks).

      The versions of python, etc. are:

      $ python --version
      Python 3.8.2
      
      $ pip --version
      pip 20.3.3 from c:\python38\lib\site-packages\pip (python 3.8)
      
      $ python -m pip install -r requirements.txt
      Looking in indexes: https://pypi.org/simple, https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/
      Ignoring opencv-python: markers 'platform_machine == "armv7l"' don't match your environment
      Requirement already satisfied: opencv-python==4.2.0.34 in c:\python38\lib\site-packages (from -r requirements.txt (line 1)) (4.2.0.34)
      Requirement already satisfied: depthai==0.0.2.1+b9918c481abaaeac51dd1d2b80fe6a150612f90a in c:\python38\lib\site-packages (from -r requirements.txt (line 4)) (0.0.2.1+b9918c481abaaeac51dd1d2b80fe6a150612f90a)
      Requirement already satisfied: numpy>=1.17.3 in c:\python38\lib\site-packages (from opencv-python==4.2.0.34->-r requirements.txt (line 1)) (1.19.3

      The version of the codebase I was testing was https://github.com/luxonis/depthai-experiments/commit/7cfbd821f65fda1613de90579a030e8ac77eff39

      Let me know if there's anything else I can provide on this and I promise I'll be slightly quicker in responding next time 🙂

      Thanks,

      Nick

        Thank you Thingymagig . This helps for sure. Asking Lukasz on this, I think he has a Windows machine to reproduce on.

        Thanks again,
        Brandon

        So Lukasz updated this over the weekend, so it should no longer crash. Update from him on it:

        I have fixed the example just now - reason that it failed was one of the bounding box coordinates coming from nn had a negative value (and we cannot crop a frame with a negative coordinate). Used np.crop(bbox, 0, 1) so that bounding box values are always between 0 and 1 (FWIW)

        Thanks,
        Brandon