PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
263 stars 184 forks source link

Copy mat before running Rknn detect to hopefully mitigate #1182 #1280

Closed DrewTheRat closed 6 months ago

DrewTheRat commented 6 months ago

This change is an educated guess based on the following:

So, if the camera get hosed when we pass its buffer to the Rknn detection, maybe creating a copy first will avoid the issue. After making this change, I could not reproduce the issue using the same method that previously caused the crash.

I also ran detection over a couple hours and did not observe memory growth in the process.

Way too much discussion and detail in this thread on Discord.

DrewTheRat commented 6 months ago

I'm closing this unmerged. The change did not work on the robot at an event. It's behaving the same as v2024.2.10.