ITBees.PlateRecognition 8.0.10

dotnet add package ITBees.PlateRecognition --version 8.0.10
                    
NuGet\Install-Package ITBees.PlateRecognition -Version 8.0.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ITBees.PlateRecognition" Version="8.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ITBees.PlateRecognition" Version="8.0.10" />
                    
Directory.Packages.props
<PackageReference Include="ITBees.PlateRecognition" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ITBees.PlateRecognition --version 8.0.10
                    
#r "nuget: ITBees.PlateRecognition, 8.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ITBees.PlateRecognition@8.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ITBees.PlateRecognition&version=8.0.10
                    
Install as a Cake Addin
#tool nuget:?package=ITBees.PlateRecognition&version=8.0.10
                    
Install as a Cake Tool

ITBees.PlateRecognition

Licence plate recognition from a still image (a camera snapshot), locally, in process, on the CPU - no Python, no separate service, no cloud. Runs wherever .NET 8 and ONNX Runtime run: Windows and Linux, x64 and arm64 (Chipsee columns, local servers, AdminApi).

  • detector: YOLOv9-t 640 trained on plates (open-image-models, end-to-end NMS),
  • OCR: CCT-S v2 global (fast-plate-ocr, 10 character slots, also guesses the country),
  • both are the ONNX models of the Python fast-alpr package; this library reproduces its pre- and post-processing (OpenCV bilinear resize, YOLO letterbox, slot decoding) so the results match it.

Quick start

services.AddPlateRecognition();                       // or AddPlateRecognition(configuration.GetSection("PlateRecognition"))

var result = await plateRecognizer.RecognizeAsync(jpegBytes);
if (result.Best is { Confidence: >= 0.9 } plate)
{
    // plate.Text = "WW763YF", plate.Box = position in the image, plate.Region = "Poland"
}

RecognizeAsync takes JPEG/PNG/BMP/WebP bytes and an optional region of interest (e.g. without the text strip some cameras burn under the picture; returned boxes stay in whole-image coordinates). The first call loads the models (about 2 s, ~100 MB of memory), WarmUpAsync() does it earlier. Register the recognizer as a singleton (AddPlateRecognition does).

How a frame is read

  1. The detector looks at the whole frame. Every plate box is cut out of the original image and read by the OCR. Confidence = the lowest probability over all 10 character slots, so one unsure character or an unsure length lowers it.
  2. Close-ups (RefinePlates) of the small plates: up to 3 plates of the whole frame narrower than 80 px on the detector's input (RefineBelowInputPixels), the biggest first, are found and read once more in a crop around them (a plate width to each side, two heights up and down) by the 384 px version of the detector (RefineDetectorSize). There the plate is several times bigger, so the box fits the characters - a box from the downscaled whole frame may cut off the last character (WPR2178 for WPR2178S). A bigger plate is boxed precisely already: a car standing at the camera is read with 1 detector run.
  3. Tiles, only when nothing so far is certain (SkipTilesAboveConfidence, 0.99): 6 overlapping tiles (2 rows x 3 columns, half the width, two thirds of the height). Plates far from the camera or on a fisheye frame are found only there.
  4. PlateTextRules (Polish plates, PolishPlateRules, on by default): an I from the fourth character on is read as 1; only 4-8 letters and digits with at least one of each count as a plate (drops road signs such as "ZAKAZ PALENIA" and logos); the same text from several searches is kept once; a text that is a part of a longer one (a plate cut by a tile edge) is dropped.
  5. Plates is ordered by confidence (to 0.01), then by box size - of two equally certain plates the bigger one belongs to the car closer to the camera, i.e. the one at the barrier.

RawReads keeps every OCR read before the rules, for logs.

Accuracy and speed

Measured on 196 frames of 8 parking cameras (Cibet, Toruń, Sandomierz, Zielona Góra; day and night, stopped and moving cars), truth = camera reads with disagreements checked by hand:

correct detector runs per frame (all / big plates) median time
this library, defaults (close-ups of small plates at 384 px, tiles only when not sure) 93.9 %, same pick as Python fast-alpr in 192 of 196 3.6 / 2.1 0.35 s
close-ups of every plate at 640 px (8.0.9) 93.9 % 3.8 / 2.9 0.4 s
tiles always (SkipTilesAboveConfidence = null, RefinePlates = false) 93.4 %, same pick as Python in 190 of 196 7.0 1.0 s
OCR CCT-XS (OcrModel = ExtraSmall) 91.8 % 3.9
Python fast-alpr, same rules 95 % 7
whole frame only (UseTiles = false, no close-ups) ~63 % 1

Per parking (defaults): Cibet 50/50, Zielona Góra 48/50, Toruń 25/25, Sandomierz 61/71 (the Wjazd 5 camera sees 2-3 cars at once); plates at least 60 px wide on the detector's input (cars close to the camera) 52/53.

The frames that differ from Python all show 2-3 cars read at confidence 1.00 each; this library takes the closer one. Every frame of a car standing at the barrier was read correctly. Errors: another car in the frame, far cars with headlights at night, very dark frames.

Times are for a 2688x1520 frame on a desktop x64 CPU (4 threads). On an arm64 Chipsee column the first read of a 704x576 snapshot with 7 detector runs (2 threads, no warm-up yet) took 18 s - hence the close-ups instead of the tiles for a plate that is already certain. The models' first run happens in WarmUpAsync (ONNX Runtime prepares its kernels then), not on the first image.

The benchmark is BenchmarkTests (it runs when PLATE_BENCHMARK_TSV points to the frames list of the Python reference run; the frames are not in the repository, they show real cars).

Models

Downloaded on the first use from the authors' GitHub releases (~21 MB with the defaults), checked against pinned SHA-256 and kept in ModelDirectory (default ~/.local/share/itbees-plate-recognition/models, on Windows %LOCALAPPDATA%\itbees-plate-recognition\models). A device without internet: copy the files there and set DownloadModels = false.

File Used SHA-256
yolo-v9-t-640-license-plates-end2end.onnx always c3c1026c...0c076
yolo-v9-t-384-license-plates-end2end.onnx close-ups (RefineDetectorSize 384) 888397b9...a77a8
yolo-v9-t-416-license-plates-end2end.onnx close-ups (RefineDetectorSize 416) 0469d81f...73fe4
cct_s_v2_global.onnx OcrModel Small 384bbbd2...6e47b
cct_xs_v2_global.onnx OcrModel ExtraSmall 8031afb5...f44
cct_s_v2_global_plate_config.yaml always 0335c74a...0a6

A fine-tuned model (trained with fast-plate-ocr in Python and exported to ONNX) is loaded with OcrModelPath + OcrConfigPath (its plate config YAML), a custom detector with DetectorModelPath.

Options

Option Default
ModelDirectory see above where the models are
DownloadModels true download missing models
DetectorConfidence 0.25 minimum detector score
UseTiles true search the 6 tiles when nothing is certain
RefinePlates true read the whole-frame plates again from close-ups
RefineBelowInputPixels 80 close-ups only for plates narrower than this on the 640 px input; null = all
RefineDetectorSize 384 close-up detector: 640, 416 or 384
OcrModel Small CCT-S; ExtraSmall = CCT-XS, faster, less accurate
SkipTilesAboveConfidence 0.99 skip the tiles when a plate is this certain; null = always
PolishPlateRules true Polish plate rules (above)
IntraOpThreads half of the cores CPU threads per model run
MaxConcurrentRecognitions 1 more calls wait

Native libraries and app size

ONNX Runtime and SkiaSharp ship native libraries for about 20 platforms (over 600 MB with symbols). The package adds a build step (buildTransitive/ITBees.PlateRecognition.targets) that keeps only linux-arm64, linux-x64 and win-x64 in a portable build or publish, without symbol files: about 75 MB, ~26 MB per platform. Another platform is added in the app's project:

<PlateRecognitionRuntimeIdentifiers>linux-arm64;linux-x64;win-x64;osx-arm64</PlateRecognitionRuntimeIdentifiers>

An app published for one RuntimeIdentifier gets only that platform anyway.

Licences

The library is MIT. ONNX Runtime and SkiaSharp are MIT. The models are published by their author under MIT (fast-plate-ocr, open-image-models); the detector is a YOLOv9 architecture, whose reference implementation is GPL-3.0 - the library downloads the weights from the author instead of shipping them.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.10 113 11/24/2026
8.0.9 79 11/23/2026
8.0.8 92 11/23/2026
8.0.7 91 11/23/2026
8.0.6 91 11/23/2026