CodeProject.AI ALPR on GPU on Linux / CUDA 12.x (PaddleOCR) + a vehicle-crop backport

bubba

n3wb
Jul 16, 2018
5
0
California
Title: CodeProject.AI ALPR on GPU on Linux / CUDA 12.x (PaddleOCR) + a vehicle-crop backport

For anyone running CodeProject.AI ALPR on Linux with an NVIDIA GPU: no ALPR module
currently uses the GPU on Linux — the stock PaddleOCR module is CPU-only there, and
@MikeLud's newer YOLO11 module is DirectML (Windows) / MPS (Apple). I put together a
fork + two PRs that close that for the PaddleOCR module:

1) PaddleOCR ALPR on GPU / CUDA 12 on Linux. Three small fixes: pin the CUDA-12
paddlepaddle-gpu 2.6.2.post120 wheel + its index (PyPI only ships CUDA<=11.7), flip
InstallGPU:true, and symlink libcudnn.so->.so.8. Now inferenceDevice=GPU. Tested on
an RTX A5000, CUDA 12.4/12.7 driver, cuDNN 8.9 (the .post120 wheel works across
CUDA 12.0-12.7 via forward compatibility).

2) Vehicle-crop fallback for wide/4K scenes. Full disclosure — this is the same
technique MikeLud's YOLO11 module already has (ENABLE_VEHICLE_DETECTION); I just
backported it to the PaddleOCR module. If the full-frame plate pass misses, it
detects vehicles, crops them, and re-runs plate detection on the crops, so a plate
that's ~10px after the detector's 640 resize still reads.

Repo (enhanced = both fixes, README + before/after screenshot):
PRs:

Honestly the GPU-on-Linux piece is the useful bit; the crop just tides PaddleOCR-on-Linux
users over until the YOLO11 module gets CUDA/Linux — which looks very doable, its
session_manager already has a CUDAExecutionProvider path and just ships
onnxruntime-directml. Feedback welcome, especially from MikeLud.
 
Title: CodeProject.AI ALPR on GPU on Linux / CUDA 12.x (PaddleOCR) + a vehicle-crop backport

For anyone running CodeProject.AI ALPR on Linux with an NVIDIA GPU: no ALPR module
currently uses the GPU on Linux — the stock PaddleOCR module is CPU-only there, and
@MikeLud's newer YOLO11 module is DirectML (Windows) / MPS (Apple). I put together a
fork + two PRs that close that for the PaddleOCR module:

1) PaddleOCR ALPR on GPU / CUDA 12 on Linux. Three small fixes: pin the CUDA-12
paddlepaddle-gpu 2.6.2.post120 wheel + its index (PyPI only ships CUDA<=11.7), flip
InstallGPU:true, and symlink libcudnn.so->.so.8. Now inferenceDevice=GPU. Tested on
an RTX A5000, CUDA 12.4/12.7 driver, cuDNN 8.9 (the .post120 wheel works across
CUDA 12.0-12.7 via forward compatibility).

2) Vehicle-crop fallback for wide/4K scenes. Full disclosure — this is the same
technique MikeLud's YOLO11 module already has (ENABLE_VEHICLE_DETECTION); I just
backported it to the PaddleOCR module. If the full-frame plate pass misses, it
detects vehicles, crops them, and re-runs plate detection on the crops, so a plate
that's ~10px after the detector's 640 resize still reads.

Repo (enhanced = both fixes, README + before/after screenshot):
PRs:

Honestly the GPU-on-Linux piece is the useful bit; the crop just tides PaddleOCR-on-Linux
users over until the YOLO11 module gets CUDA/Linux — which looks very doable, its
session_manager already has a CUDAExecutionProvider path and just ships
onnxruntime-directml. Feedback welcome, especially from MikeLud.
For the OCR you should look at Fast Plate OCR, it is more accurate then PaddleOCR. This what Blue Iris is using for the OCR