codeproject / CodeProject.AI-Server

CodeProject.AI Server is a self contained service that software developers can include in, and distribute with, their applications in order to augment their apps with the power of AI.
https://codeproject.github.io/codeproject.ai
Other
732 stars 160 forks source link

ALPR_adapter.py Constantly Throwing Traceback Error #161

Closed SquigglyPiffin closed 1 week ago

SquigglyPiffin commented 1 week ago

After finally fixing issues with the paddle installation, now the License Plate Reader module works, but every time a request is sent to it and returns with no license plate, then it throws this error:

License Plate Reader: [KeyError] : Traceback (most recent call last): File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR_adapter.py", line 59, in process predictions = result["predictions"] KeyError: 'predictions' ALPR_adapter.txt

Which is a LOT of times. I am attaching an updated ALPR_adapter.py file that has a fix for this. Instead of returning with an error message every time, it will simply say "No license plate detected" and move on like normal.