platekit "Adjacent" · Per-deployment licensing

platekit · "Adjacent" · plates + 5 OCR plugins

Plates,
and five neighbours.

"Adjacent" pulls the entire M2 + M3 capability horizon into code. Five new adjacent-OCR plugins (shipping containers, VINs, make/model/colour, rail reporting marks, hazmat placards) and a Protocol scaffold for learned super-resolution sit alongside the 215-export plate-OCR core. The same library powers Hearth, Curb, YardSight, Eyrie — and now ports, rail terminals, fleets and parking yards too. Per-deployment commercial licensing with OEM authorisation, indemnity, and a written SLA on every tier.

from platekit import ANPR
for e in ANPR().stream("rtsp://gate-1/main"):
    print(e.plate, e.confidence, e.region)
+5
Adjacent OCR plugins
Containers · VIN · MMR · rail-mark · hazmat
21
Region packs
US · EU · IN · BR · CN · JP · AU · ZA · auto
18
India-specific modules
HSRP · FASTag · Vahan · e-Challan
433
Tests
+95 in "Adjacent" · all green
0
CUDA installs required
ONNX everywhere

01 — The pipeline

One pipeline. Every layer wireable.

Sources, the ANPR class, trackers, aggregators, and sinks compose into a single declarative pipeline. Every link is a protocol you can replace — detector, OCR, sink, tracker, backend — so you can grow into the SDK rather than fight it.

Sources

Ingest from anything.

Files, folders, webcams, RTSP cameras, ONVIF discovery. Open via open_source(uri) or instantiate directly. The same Source ABC underpins every input.

FileSource · ImageSource · RTSPSource · WebcamSource
Detection + OCR

FastALPR by default.

The default Backend is FastALPR — fast, CPU-friendly, ships with bundled weights. Bring your own via the Detector + OCR protocols.

ANPR(backend=FastALPRBackend())
Tracking

ByteTrack out of the box.

ByteTrackTracker associates detections across frames so a single car driving past produces one tracked read, not twenty fragments.

ByteTrackTracker(track_buffer=30)
Aggregation

Track → canonical read.

TrackAggregator promotes the best per-track read into a single PlateEvent, with confidence and OCR-confidence fields preserved.

TrackAggregator(window_seconds=2.5)
Sinks

One ABC, infinite destinations.

Stdout, NDJSON, files, rotating files, MQTT, webhooks, Slack, Kafka, S3, Prometheus, WebSocket broadcast — composable as wrappers.

MultiSink([StdoutSink(), S3Sink(...), KafkaSink(...)])
Runner

One call, full loop.

StreamProcessor wires source → ANPR → tracker → aggregator → sinks and runs the loop until you stop it. CLI uses the same runner.

StreamProcessor(source, anpr, sink).run()

02 — Streaming & sinks

Defence-in-depth for live pipelines.

Sinks compose. Every filter is also a sink — wrap one in the next, end with your destination. Operators get rate limits, kill switches, confidence floors, deduplication, hotlists, schema enforcement, and observability hooks. All in one ABC.

Sinks · destinations

  • StdoutSink — dev / smoke tests.
  • FileSink / RotatingFileSink — NDJSON on disk.
  • MQTTSink — local broker fan-out (Mosquitto, IoT Core).
  • WebhookSink — HMAC-signed; turnkey integrations.
  • SlackSink — hotlist hits, exception alerts.
  • KafkaSink — partitioned high-throughput.
  • S3Sink — cold archive to S3 / MinIO / R2.
  • PrometheusSink — embedded /metrics endpoint.
  • BroadcastSink — WebSocket fan-out for dashboards.
  • MultiSink — parallel fan-out to many destinations.

Wrappers · filters & observability

  • ConfidenceFilterSink — drop reads below thresholds.
  • MaxAgeSink — defend against stale replays.
  • RateThrottleSink — global token-bucket; drops excess.
  • BackpressureSink — bounded queue; drop_old / drop_new.
  • ThrottleSink — per-plate alert cooldown.
  • Deduper / BloomDeduperSink — tunable FP-rate dedup.
  • KillSwitchSink — hot operator stop without restart.
  • SchemaSink — validate every event against your contract.
  • HotlistFilterSink — annotate or block known plates.
  • LatencyTrackerSink — observability tap.
from platekit import ANPR, open_source, StreamProcessor
from platekit.sinks import StdoutSink, RotatingFileSink, MultiSink
from platekit.network_sinks import WebhookSink, MQTTSink

source = open_source("rtsp://10.0.0.10/main")
anpr   = ANPR.from_default(region="auto")

sinks = MultiSink([
    ConfidenceFilterSink(StdoutSink(),     min_confidence=0.85),
    KillSwitchSink(WebhookSink("https://ops/api", secret="…")),
    BloomDeduperSink(RotatingFileSink("logs/anpr.ndjson"), window_seconds=90),
    MQTTSink("mqtt://broker.lan/anpr"),
])

StreamProcessor(source, anpr, sinks).run()

03 — Region packs

Plates are not universal. Neither is one regex.

Region packs encode the syntax rules, common OCR noises, and common-pattern lists for a specific market. At runtime, region="auto" picks the most plausible pack per read; you can also force a region per source or pin one globally. Adding a new region is minor; per the Stability Policy a pack's region code is stable from 1.0.

US EU IN BR · Mercosur CN UK · GB-suffix CA AU JP SG ZA NZ AE SA TR MX + 5 more AutoRegionPack

04 — India

The deepest India ANPR support in any SDK.

India isn't a generic region. It has state codes, BH-series, HSRP holograms, FASTag classes, state-specific e-Challan portals, the Vahan database, PUC certificates, RTO tiers, and a wholly distinct OCR-noise profile. PlateKit ships 18 dedicated modules that capture all of it.

ModuleWhat it does
platekit.indiaIndianPlate dataclass · STATE_CODES · BH-series helpers · two-row reassembly
platekit.india_hsrpHSRP code parsing + verifier protocol
platekit.india_fastagFASTag class enum · NETC tag-colour mapping · guess_class()
platekit.india_echallanPer-state e-Challan portal URLs (national fallback)
platekit.india_vahanVahan adapter · StubVahanClient + rate-limited bulk-fetch
platekit.india_districtsRTO district codes · known_districts_for_state()
platekit.india_rto_tierTier classification for every RTO
platekit.india_zoneNorth / south / east / west classifier per RTO
platekit.india_populationState population + tier (official census tables)
platekit.india_speedState-level default speed limits (highway / urban)
platekit.india_tollMajor NHAI toll plaza directory
platekit.india_compliancePUC status · MLFF pay-by helpers · DPDP retention cutoff
platekit.india_normalizeStrip Devanagari overlays, HSRP prefixes, frame noise
platekit.india_form_factorAspect-ratio classifier for one-row vs two-row plates
platekit.india_fancyDetect "fancy" / VIP plate patterns (0001, AB-007, …)
platekit.india_originOut-of-state vehicle detection by state-code mismatch
platekit.india_categoryVehicle-category inference from plate colour bands
platekit.india_pipelineEnd-to-end India post-processing — chain all of the above

A separate proprietary wheel — platekit-india-pro — ships the live Masters India Vahan client with retry, auth, and envelope handling. See Commercial License.

05 — "Adjacent" capability horizon · M2 / M3, pulled forward

Plates plus five neighbours.

Five adjacent-OCR plugins ship in the "Adjacent" release. Each is a small module exposing a clean Protocol, a deterministic stub adapter for tests, and well-defined inputs / outputs — so production model adapters plug in without changing the rest of the pipeline. The math (check digits, banned characters, UN-number ranges) is pure-Python and exhaustively tested.

01 · containers

For ports, intermodal, rail yards

ISO 6346 containers — mod-11 check digit.

3-letter owner code, U/J/Z category, 6-digit serial plus the mod-11 check digit. ContainerOCR Protocol + StubContainerOCR adapter; pure-Python check-digit calculator + is_valid() + parse() helpers. Powers YardSight container OCR; available standalone as a PlateKit plugin.

platekit.containers · ContainerOCR
02 · VIN

For auction lots, fleet yards, warranty checks

ISO 3779 VINs — FMVSS Part 565 check digit.

17-char Vehicle Identification Numbers with transliteration-based check digit at position 9. VinOCR Protocol + StubVinOCR adapter. compute_check_digit() and decode_model_year() helpers. I / O / Q correctly excluded from the alphabet.

platekit.vin · VinOCR
03 · MMR

For Smart City, fleet tagging, parking analytics

Make / Model / Colour recognition.

MmrModel Protocol + StubMmr adapter. Top-50 Indian makes catalogue, 16-bucket colour palette, 20-body-style RTO taxonomy (auto-rickshaw, MUV, MCV, HCV included). Plug in vendor MMR models behind the Protocol without pipeline changes.

platekit.mmr · MmrModel
04 · rail-mark

For intermodal terminals, Class-I railroads

AAR reporting marks + UMLER numbers.

15 major Class-I North American reporting marks (BNSF, UP, CSX, NS, CN, CP, KCS, GTW, IC, FXE, TFM, SAR, ARR, AC, WC). RailMarkOCR Protocol + StubRailMarkOCR adapter. parse() validator and is_known_mark() checker.

platekit.rail_mark · RailMarkOCR
05 · hazmat

For weigh stations, customs, CTPAT

UN-class hazmat placards.

HazmatOCR Protocol + StubHazmatOCR adapter covering all 9 hazard classes + sub-divisions per UN Model Regulations §5.2.2. UN-number range validation (1001..3548). Placard-colour-for-class lookup for redundant verification.

platekit.hazmat · HazmatOCR
06 · super-res

For distant cameras, low-light, plate denoising

Learned super-resolution — Protocol scaffolding.

SuperResolver Protocol ready for LP-Diff, LCDNet, SwinIR, HAT and other diffusion / transformer adapters. Ships IdentitySuperResolver (passthrough) + NearestSuperResolver (numpy nearest-neighbour) as deterministic stubs; LanczosUpscale remains the recommended deterministic fallback. Production models plug in without pipeline changes.

platekit.super_res · SuperResolver

+95 new tests across test_containers.py, test_vin.py, test_mmr.py, test_rail_mark.py, test_hazmat.py, test_super_res.py — every check-digit calculation, every alphabet exclusion, every UN-number range, every SR shape / dtype invariant covered. PRD-03 §9 M2 + M3 capability surface now in code.

06 — Backends + model zoo

Bring your own model. Or use ours.

FastALPR is the default Backend; bundled weights mean zero additional downloads on first run. For larger deployments, the model zoo lets you list, fetch, and pin to specific versions; for in-house models, you implement Detector + OCR protocols and PlateKit handles the rest.

FastALPRBackend

The CPU-first default.

ONNX-backed detect + OCR. Ships DEFAULT_DETECT and DEFAULT_OCR constants you can override per environment.

FastALPRBackend(detect_model=..., ocr_model=...)
Model zoo

list / get / download.

Pin to specific weights by name + version. Cache lives outside the package so containers stay small.

platekit.models.zoo
Preprocessing

Crop, Lanczos, identity.

Composable preprocessors run before the detector. Easy to wedge your own (deblur, denoise, contrast equalisation).

platekit.preprocess
Fallbacks

VLM + Gemini fallback.

When the primary OCR is uncertain, fall back to a vision-language model. Routes through the configured provider; never leaks images by default.

platekit.fallback

07 — Server & CLI

One build_app(). Operationally complete.

platekit.serve.build_app() returns a FastAPI ASGI app exposing live events, recent reads, regions, model info, and a /metrics scrape endpoint when PrometheusSink is wired. Every flag, every exit code, every NDJSON event schema is stable under SemVer.

GET /events

WebSocket feed.

Broadcast of every PlateEvent through BroadcastSink. Dashboards subscribe; no polling.

ws://host:8080/events
GET /recent

Last N reads.

Backfill new clients on connect. Optional region + camera filters.

/recent?region=in&camera=gate-1
GET /regions

Active region packs.

Reflection — what AutoRegionPack will route to. Useful for debugging.

/regions
GET /healthz · /metrics

Health + Prometheus.

Liveness probe and embedded /metrics endpoint (when PrometheusSink is wired).

/healthz · /metrics
# Run a live RTSP source through the default pipeline:
platekit run "rtsp://10.0.0.10/main" \
        --region auto \
        --sink "stdout" \
        --sink "file:logs/anpr.ndjson" \
        --sink "webhook:https://ops/api?secret=…"

# Replay yesterday's NDJSON through a new sink set:
platekit replay logs/2026-05-17.ndjson --sink "slack:#anpr-alerts"

# Benchmark on a folder of frames:
platekit benchmark frames/ --backend fastalpr --region in

# List and pin model weights:
platekit models list
platekit models pin fastalpr-detect@1.2.0

# Run the operator console:
platekit serve --host 0.0.0.0 --port 8080

08 — Stability

v1.0 SemVer commitment. Frozen public surface.

STABILITY.md is the contract: PlateEvent, ANPR, region packs, sinks — none of these change shape inside a major version. Migrate up a major when you want to, not when we feel like rewriting.

Stable surface

  • platekit — ANPR, StreamProcessor, sources, sinks, trackers, types, protocols.
  • platekit.region — region packs and pack classes.
  • platekit.sinks + network_sinks — destinations and wrappers.
  • platekit.runner + serve — build_app(), every FastAPI route.
  • platekit.models.* — FastALPRBackend, the zoo API, model info.
  • platekit.india.* — 18 modules, stable under SemVer from 1.6.
  • platekit.cli — command names, flags, exit codes, NDJSON schema.

Bumps

  • PATCH (1.0.x)
    Bug fixes, perf improvements without semantic output changes.
  • MINOR (1.y.0)
    Additive features, new region packs, new optional kwargs with defaults preserving prior behaviour.
  • MAJOR (X.0.0)
    Breaking changes — always with a deprecation period in the prior minor.

09 — Why PlateKit

Five reasons procurement chooses PlateKit.

PlateKit is a licensed Python ANPR SDK. Five things included on every tier that off-the-shelf OCR services and generic CV vendors don't ship — any one of which is usually enough to make the choice.

— Reason · 01

OEM authorisation letter for public tenders

Indian government and PSU RFPs in ANPR, ITMS, e-Challan, MLFF tolling and Smart Cities almost universally require an OEM letter naming the bidder as authorised SI. Generic OCR vendors don't issue one; PlateKit Solo includes one per year, Team and Enterprise are unlimited — all on company letterhead, DSC-signed.

— Reason · 02

Contractual indemnity against third-party IP claims

Most OCR vendors ship as is with no warranty. Procurement teams at large enterprises and government agencies routinely require indemnity caps; PlateKit provides $50K, $250K, or negotiated caps — bound to the licence agreement, not a marketing page.

— Reason · 03

Priority support with a contractual SLA

Generic OCR vendors offer email support with no contractual SLA. PlateKit provides response-time targets per severity, named engineering contacts, and a written escalation path on every tier.

— Reason · 04

The platekit-india-pro connectors

Authenticated, retry-aware adapters for Vahan (Masters India, Surepass, Signzy, KarzaTech), NPCI NETC FASTag, IRDAI IIB lookup, and the parivahan.gov.in e-Challan submission API. Bundled with the library; deployment count by tier.

— Reason · 05

Custom procurement terms

Master service agreement, multi-year terms, source escrow, bespoke warranty caps, net-30 payment with PO workflow, and other arrangements typical of Enterprise procurement.

Most procurement teams care about three or more of these. Solo handles single-deployment requirements; Team scales across five sites with unlimited OEM letters; Enterprise is custom.

10 — Pricing

Per-deployment commercial licensing.

Three tiers, billed annually, all in USD with INR billing available via Paddle (registered seller of record). Indemnification, OEM authorisation letters, priority support, and written SLAs scale with the tier. Trial licences are available on written request to evaluate against your own corpus.

Solo · Tier I

USD 2,000 / yr · ~₹1.7L

$2K /yr

First commercial tier

  • 1 production deployment
  • 1 OEM letter / yr
  • 5-business-day response
  • $50K / $100K indemnity cap
  • India Pro · 1 deployment

Enterprise · Tier III

Negotiated

Custom

99.9% SLA available

  • Negotiated deployments
  • Bespoke SLA
  • Source escrow (option)
  • 24×7 incident response (option)
  • Sub-licensing (option)

Paddle bills in the licensee's local currency at the prevailing exchange rate. Indian licensees are billed in INR; Paddle as registered seller of record issues the GST-compliant tax invoice and captures the licensee's GSTIN at checkout for Input Tax Credit where applicable.

11 — How to buy

One short email begins the process.

Two paths. Solo and Team self-serve through Paddle checkout. Enterprise gets a 30-minute scoping call, a master service agreement, and Paddle MoR or direct billing — whichever your procurement prefers.

— Path A · Paddle checkout

Solo or Team

Email singh.anshuman@icycastle.com with your legal entity, GSTIN (Indian licensees) and tier. You receive a Paddle checkout link within one business day; on payment, the welcome email follows with private repo access for platekit-india-pro and your first OEM letter.

— Path B · Enterprise MSA

Custom contract

Email the same address with procurement context: expected deployment count, geography, custom terms required, target start date. 30-minute scoping call within 5 business days; MSA drafted within 10. Signed electronically via Zoho Sign or your preferred platform.

— Hours · à la carte

USD 200 / hour · ~₹16.5K

Paid engineering hours for Vahan / FASTag / e-Challan implementation, Kafka or S3 production wiring, threshold calibration on a labelled set, region-pack extension, OpenTelemetry roll-out, HMAC chain-of-custody. Minimum block 5 hours.

— SoW · fixed-price

> 40 hours · scoped

Engagements above 40 hours can be scoped as a fixed-price statement of work. Typical work product is committed code in your repository, accompanied by tests and a brief design note.

12 — For Indian tender & RFP buyers

Built for the OEM-authorisation requirement.

ICYCASTLE INFOTAINMENT PRIVATE LIMITED issues OEM authorisation letters on company letterhead, digitally signed with a DSC from a CCA-licensed Certifying Authority (eMudhra, Sify, or Capricorn). Each letter is tender-specific, valid through the award decision plus ninety days, and names the bidder as the authorised system integrator.

21
Region packs supported
Deep India surface across 36 state and UT codes
18
India-specific modules
HSRP · Vahan · FASTag · e-Challan · GSTIN · PAN · DPDP
2day
OEM letter response
Courier hard-copy with company seal on request
Class-I
DPIIT local content
≥ 50% under P-45021/2/2017-PP

The OEM is an Indian Private Limited company registered with the Ministry of Corporate Affairs. Statutory filings are publicly accessible at mca.gov.in for evaluators who prefer independent verification. The complete buyer guide is at TENDER-COMPLIANCE.md.

13 — Install

From RTSP to a plate event,
in three lines.

ONNX everywhere. Reproducible benchmarks. The library that powers Hearth, Curb, YardSight and Eyrie — and now yours.