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):
github.com
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 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):
GitHub - chsbusch-dot/CodeProject.AI-ALPR: An ALPR module for CodeProject.AI Server
An ALPR module for CodeProject.AI Server. Contribute to chsbusch-dot/CodeProject.AI-ALPR development by creating an account on GitHub.
- GPU on Linux: Enable PaddleOCR GPU on Linux / CUDA 12 by chsbusch-dot · Pull Request #25 · codeproject/CodeProject.AI-ALPR
- Vehicle-crop: Add a vehicle-crop fallback so plates in wide / high-resolution scenes still read by chsbusch-dot · Pull Request #26 · codeproject/CodeProject.AI-ALPR
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.