I am working on making License Plate Module for the below project and I am getting FileNotFoundError: [WinError 2] The system cannot find the file specified when running the project. It works fine using an interactive window
Project Link:
GitHub - codeproject/CodeProject.AI-Server: CodeProject SenseAI 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.[
^]
License Plate Module Link:
CodeProject.AI-Server/src/modules/ALPR at main · MikeLud/CodeProject.AI-Server · GitHub[
^]
Works fine using an interactive window image
https://github.com/MikeLud/CodeProject.AI-Server/blob/main/src/modules/ALPR/wYNgt.png[
^]
2022-10-29 15:32:56: Started License Plate Reader backend
2022-10-29 15:32:57: Traceback (most recent call last):
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\modules\ALPR\ALPR_adapter.py", line 15, in <module>
2022-10-29 15:32:57: from ALPR import detect_platenumber
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\modules\ALPR\ALPR.py", line 14, in <module>
2022-10-29 15:32:57: from paddleocr import PaddleOCR
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\venv\lib\site-packages\paddleocr\__init__.py", line 14, in <module>
2022-10-29 15:32:57: from .paddleocr import *
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\venv\lib\site-packages\paddleocr\paddleocr.py", line 21, in <module>
2022-10-29 15:32:57: import paddle
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\venv\lib\site-packages\paddle\__init__.py", line 71, in <module>
2022-10-29 15:32:57: import paddle.dataset
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\venv\lib\site-packages\paddle\dataset\__init__.py", line 27, in <module>
2022-10-29 15:32:57: import paddle.dataset.flowers
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\venv\lib\site-packages\paddle\dataset\flowers.py", line 39, in <module>
2022-10-29 15:32:57: from paddle.dataset.image import load_image_bytes
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\venv\lib\site-packages\paddle\dataset\image.py", line 51, in <module>
2022-10-29 15:32:57: stderr=subprocess.PIPE)
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\lib\subprocess.py", line 800, in __init__
2022-10-29 15:32:57: restore_signals, start_new_session)
2022-10-29 15:32:57: File "E:\Repos\CodeProject.AI-Server-1\src\AnalysisLayer\bin\windows\python37\lib\subprocess.py", line 1207, in _execute_child
2022-10-29 15:32:57: startupinfo)
2022-10-29 15:32:57: FileNotFoundError: [WinError 2] The system cannot find the file specified
2022-10-29 15:32:57: ALPR_adapter.py: has exited
What I have tried:
OCR='Paddle'
import io
from PIL import Image
from codeprojectai import CodeProjectAIRunner
from common import JSON
from analysislogging import LogMethod
from options import Options
opts = Options()
if OCR == 'Paddle':
from paddleocr import PaddleOCR
ocr = PaddleOCR(lang='en', rec_algorithm='CRNN', \
cls_model_dir='paddleocr/ch_ppocr_mobile_v2.0_cls_infer', \
det_model_dir='paddleocr/en_PP-OCRv3_det_infer', \
rec_model_dir='paddleocr/en_PP-OCRv3_rec_infer')
try:
with io.BytesIO() as plate_buffer :
image.save(plate_buffer, format='PNG')
plate_buffer.seek(0)
ocr_response = ocr.ocr(('image.png', plate_buffer, 'image/png'), cls=True)