Skip to main content

cnrocr

Container number detection and recognition — ISO 6346 end-to-end, ONNX only.

A D-FINE detector locates the number, ISO type code, owner code and serial on the container; a CRNN recognizer reads each crop with a spec-constrained CTC beam search. Fragments split across panels are merged back into a single number and validated against the ISO 6346 check digit.

No PyTorch required. The runtime is onnxruntime + numpy + pillow.


Install

pip install cnrocr           # CPU
pip install cnrocr[gpu]      # NVIDIA CUDA via onnxruntime-gpu

Model weights (~113 MB) are not bundled in the wheel. They are downloaded on first use and cached locally:

cnrocr models download       # optional — happens automatically otherwise

Python API

from cnrocr import ContainerOCR

ocr = ContainerOCR()                      # weights resolved from cache
result = ocr.read("gate_cam.jpg")

for c in result.containers:
    print(c.number, c.iso_type, c.confidence, c.needs_review)
# TGHU8913884 22G1 0.9997 False

Multiple images

results = ocr.read_many(["a.jpg", "b.jpg", "c.jpg"], batch_size=8)

read_many treats the images as unrelated — N images in, N results out.

Multi-view fusion

When several cameras photograph the same container, fuse them into one answer instead of voting on strings:

mv = ocr.read_multiview(["cam1.jpg", "cam2.jpg", "cam3.jpg"])
print(mv.number, mv.agreement, mv.mode)

Beam-search candidates from every view are summed in log space, so a character that one view is unsure about can be settled by the others. If the views appear to be looking at different containers, they are not fused — mv.consensus becomes False rather than producing a confident wrong answer.

Review triage

A check digit alone is not enough. The constrained decoder only emits spec-conforming candidates, so when the true string is absent from the beam it will confidently output a plausible wrong number that still passes the check digit. needs_review combines the check digit, the spec flag and a confidence floor:

if c.needs_review:
    print(c.review_reason)     # "신뢰도 낮음 (0.612 < 0.7)"

Owner code registry (optional)

Real-world owner codes are registered with the BIC. Supplying the list filters out invented codes that would otherwise pass both the format check and the check digit:

from cnrocr import OwnerCodeRegistry
ocr = ContainerOCR(registry=OwnerCodeRegistry.from_file("bic_codes.txt"))

The list is not shipped with this package.


Command line

cnrocr read gate_cam.jpg
cnrocr read *.jpg --json --device cuda
cnrocr multiview cam1.jpg cam2.jpg cam3.jpg
cnrocr models status
cnrocr check                    # diagnose install, providers, cache

--fail-on-review makes the process exit with code 2 when any result needs human review, which is convenient in batch pipelines.


Evaluation limit

Without a licence, cnrocr processes 10 images per day. The counter is per image, not per call, and resets at 00:00 UTC.

cnrocr license      # licence status and today's usage

When the quota runs out the process exits with code 3 and prints how to ask for a licence. Nothing is processed on a call that would exceed the quota — it is all or nothing, so a refused call costs no quota.

To request an unrestricted licence, email vislab2026@gmail.com with your name, organisation and intended use. You will receive a key:

# Windows
setx CNROCR_LICENSE "eyJlbWFpbCI6..."

# macOS / Linux
export CNROCR_LICENSE='eyJlbWFpbCI6...'

The key may also be saved to a file named license in the cache directory (cnrocr models path shows where). Verify with cnrocr check.


Weights and caching

Platform Location
Cache (Windows) %LOCALAPPDATA%\cnrocr\Cache\models\<set>
Cache (macOS) ~/Library/Caches/cnrocr/models/<set>
Cache (Linux) ~/.cache/cnrocr/models/<set>

Every file is verified against a SHA-256 recorded in the wheel. Released assets are immutable: a new model set ships under a new tag and a new library version, so upgrading never invalidates an existing install.

The weights are encrypted and are decrypted into memory when a session is built. The cache holds ciphertext only; no plaintext model is written to disk.

Environment overrides:

Variable Effect
CNROCR_MODEL_DIR Use this directory as-is; never download
CNROCR_CACHE_DIR Relocate the cache root
CNROCR_WEIGHTS_BASE_URL Fetch weights from somewhere else (file:// works)

License

Proprietary. Evaluation and non-commercial research use only — see LICENSE. Contact the copyright holder for commercial licensing.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cnrocr-0.3.0-cp313-cp313-win_amd64.whl (681.8 kB view details)

Uploaded CPython 3.13Windows x86-64

cnrocr-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

cnrocr-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (5.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

cnrocr-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (721.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cnrocr-0.3.0-cp312-cp312-win_amd64.whl (687.1 kB view details)

Uploaded CPython 3.12Windows x86-64

cnrocr-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

cnrocr-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

cnrocr-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (733.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cnrocr-0.3.0-cp311-cp311-win_amd64.whl (702.1 kB view details)

Uploaded CPython 3.11Windows x86-64

cnrocr-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

cnrocr-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

cnrocr-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (742.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cnrocr-0.3.0-cp310-cp310-win_amd64.whl (701.7 kB view details)

Uploaded CPython 3.10Windows x86-64

cnrocr-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

cnrocr-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (5.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

cnrocr-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (747.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file cnrocr-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cnrocr-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 681.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for cnrocr-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 939f652dbfca2a92f172cc024d00df8f4d790d2b6f73f789442acdcb29ff76c1
MD5 a214af87fd6404aced77a63d042211aa
BLAKE2b-256 bfedc2375accddaa4df69001b64d4270c71438a1d304cb704019444f941f37d2

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dbf4258282994ae903f8acf061370db96892ce1733a0a66f4be02d368529fedf
MD5 f860c3db0c000128adf238b4a9e92622
BLAKE2b-256 3829aad1f17e40cdfbed502231ddd7e0f034238bb30be59da07a7fb2ec350734

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ad21fd2f8a66914850d3c091a2ee4c7ad90347a332b01a0c396d93b3b25c154f
MD5 e0a0ab134a79dfc5a0877b094398a456
BLAKE2b-256 af98cab7a6d83e39327e1f4ad5ee2ae8651f0fb72f2a5cd176219db04c35d63b

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 005f57187795c510e1629d36e29e1efa64e4e1db123a21fe0b6c7a6e65d0c212
MD5 e6e052451079d5af630050a779f10d31
BLAKE2b-256 b5e8655cbd8107c9f49202e020aa2b7508fdf13dd05f625298d6ad1003cd15eb

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cnrocr-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 687.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for cnrocr-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6f99e83b22510a0e8c70828141053a049b8d1dc9f20bee1187334dd32044bc7f
MD5 aad03be335ef9a0ee09510489da5ad0c
BLAKE2b-256 92e41922d470db7bd4db1d50127290fef04cdb3780513a1746cacd4a5bb442d9

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa59bc6687ebc74f1b6f2fbda299bb04f8c359850586ac7f6cdbf262fa1fc5dc
MD5 3649c3b39eea2bf48c12b711174b468e
BLAKE2b-256 c23654832bcac484112aa8392f23d15fb62722cb6fe49c3a88bd0a17b3809848

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 db1b23737a2c37b7c40399b23850fbd35aea5afe71183b402e9aa37c8893c3df
MD5 b8e8f3433b8607bf23c9915b083156c6
BLAKE2b-256 6f9009426a83a70521aa277627225f9d4c0bea42cf06ec7137b5d1ca7c7abd50

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 190029b25a184077370cd59725151622d69aa43df7913d1e4b67f32df98ba1c0
MD5 f170bafea79665ed4fa1541334675152
BLAKE2b-256 9bc34084b682cb9b181c3f26eee20277ffa7403712040c6de1ddfe393a441288

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cnrocr-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 702.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for cnrocr-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f85e59e60335bcaf6dbc6e11644c9a42e87a243bdd9c5624d30206e66ee0a32c
MD5 4058329edfd366c452e081eea1f13295
BLAKE2b-256 f1df252ea671330b1da2aba5f901f96bdbe7e0ab3880f43e2ec53fb5c4773986

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 64d1101cba28aaa8ad5af88f6c407ab8f2f51d25aab3aeda245abb27e5cced92
MD5 a78b590321302a07bafe4bcecdaa8e89
BLAKE2b-256 2cebfdc53ed2aaa533374ec95fa9f7d1f108a675082834dd1f39967334200748

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e524d12b54ed6b1817ace2bcc6623bb6348f66011ef9716204d40c1cbad93248
MD5 25da7812027aa7d12a6b18800bb1a99f
BLAKE2b-256 6976360b38b61fe5d193a8360e25b236ac4e25fd515806b9ffa3fee7bf1e4aed

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad6a356cebf1ec2d29dd3fcb54c939f4a5d978442387e07b928f921f2740e24d
MD5 deb53ec8b03b96b2521e30ba30067d88
BLAKE2b-256 e0ea78c9cd95279e20bf55e84d0fe37c60f3e15f6d350718aba31aa5c30b53aa

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cnrocr-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 701.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for cnrocr-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a61ddb7b6f637dbd911144179511ac092b52098be6117583def2c6d64ebf84ff
MD5 1b5e224f71d87b51c76d6ff999514e4a
BLAKE2b-256 92f1d78ed9de6aad319de97a8c171baee17b1e68a33b470f2e58eb639b1d627b

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f9f6042bf2f973f21ff0d60ed64771ef78d00cd5068bec5c76fb09097365d7b
MD5 a0ddf0dfab91170f798231d79e2ce836
BLAKE2b-256 5f523c8ea8853adf897490fc4fac5959a5ec36618549c94b90b7438e4848363d

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a12730385ea1837291d6d4b4f85f20a196bd27192e6f365f85f2fa6f9d90f982
MD5 022f5a7c2073a54af0a9f6696a8751bf
BLAKE2b-256 99e922ee1672a283c5d16828d91d543d6bc58a0dfe895ac3866a3dbd63d8b687

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cnrocr-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3a955106350376404e25d776cde2b051583e5c9df83c5323e301d9a7cdebf90
MD5 e9f692712484c9039ace4c799c204e51
BLAKE2b-256 bf06ce251eb2f66a31dd3002d371c5d186818afdf8f985398c51501009c09adf

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.11

20 files

0.6.10

1 file

0.6.9

1 file

0.6.8

1 file

0.6.7

20 files

0.6.6

20 files

0.6.5

20 files

0.6.4

20 files

0.6.3

20 files

0.6.2

20 files

0.6.1

20 files

0.6.0

20 files

0.5.10

20 files

0.5.9

20 files

0.5.8

20 files

0.5.7

20 files

0.5.6

20 files

0.5.5

20 files

0.5.4

20 files

0.5.3

20 files

0.5.2

20 files

0.5.1

20 files

0.5.0

20 files

0.4.2

20 files

0.4.1

20 files

0.4.0

20 files

0.3.4

16 files

0.3.3

16 files

0.3.2

16 files

0.3.1

16 files

This release

0.3.0 This release

16 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page