Skip to main content

cnrocr

PyPI Python Downloads Platform License

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.2-cp313-cp313-win_amd64.whl (681.9 kB view details)

Uploaded CPython 3.13Windows x86-64

cnrocr-0.3.2-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.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (721.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cnrocr-0.3.2-cp312-cp312-win_amd64.whl (687.2 kB view details)

Uploaded CPython 3.12Windows x86-64

cnrocr-0.3.2-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.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (733.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cnrocr-0.3.2-cp311-cp311-win_amd64.whl (702.3 kB view details)

Uploaded CPython 3.11Windows x86-64

cnrocr-0.3.2-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.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (742.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cnrocr-0.3.2-cp310-cp310-win_amd64.whl (701.8 kB view details)

Uploaded CPython 3.10Windows x86-64

cnrocr-0.3.2-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.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (748.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: cnrocr-0.3.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 681.9 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 be689efbdc3ee70584dc35f19d89160b01cdafe5e65dda98177e99594d7f8178
MD5 245050301c26f3d822bd648736b461ef
BLAKE2b-256 40f5e01a73a5a3f6f3153eda8905b967feee2710e97247f4fd6262e7c66cecd0

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.2-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.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4620e69e9e48dbcc69c4d457c8fe50d1f30d1d7b29a772f3432dc23e5b6888a7
MD5 6ca818d83d0b8ad591418dd2f470fb85
BLAKE2b-256 0017f0d62b9e7f2fbcc40d47b0de85065f5f59a13c2bbce3816853fc3fc88e28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2c66631c9ec99e9893a61c5de3a7a601efc3a123b0aaafa4bbc583c5cc9ee3b9
MD5 1da955f9d129b2a62b88c71f32c30efa
BLAKE2b-256 5c3d3962690365f6d3eb1082ea462fd8296cd1e062c5bf333bd9b6b9229d79ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3a08bc5f9e54e1ab15596fc682c9b31e2f1cfc3bfc5b7eebbcfbe9e1cd925f0
MD5 0271070ebe2b61bfd67d32a5076f7e15
BLAKE2b-256 b8487227631b077318d1b7c195f3b6476ec426c1cfe1530e5be7e450b4b4dae8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cnrocr-0.3.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 687.2 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6feb9e8c5a87ee20053a4ed5eb7ba96841a34af2e7040f7bbfa8cd351472dbde
MD5 335487af1bf455d104b4daafef95aaa5
BLAKE2b-256 2d7d721f964141634f466f871b1fe65536b4d7efd30faa9e35fb455963ccc57a

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.2-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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 effaa79c7d2f938b8d496b37f9803fe506c83773674e0dfef9b461136eef0fb8
MD5 78e4694f91858d5038e9aedb32b4814e
BLAKE2b-256 eb623ade808872b4fb833d3e21d4e845d17b240378e30c1f53b40a000f976ca5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 91f76d07ff8e40785b8c23968031536812c34b54bde651a5b6946070712f7a8c
MD5 8331ceb767ca8652cadb66d0add76a4f
BLAKE2b-256 3eb5833f5b2cd711ff3ab97b0cc5418fac59f9e44b4da3abccf9103fa47b8d07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94d9a038f73af86d2b5131edb082dc56471ff7ab6e52e9bf5b58311a2238e5b5
MD5 46eefd064885e8c4b25c7d19e3a02b7f
BLAKE2b-256 3db69ec2112161a8df602ef62432afcbcd9692270c08a8025c1a903f970ccde2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cnrocr-0.3.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 702.3 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c5a22650ab16fe6a03e2acb598c5554bc2a800d4fad4cae6c424ac532285e623
MD5 9ad834f24b2607176410088b4c2c28ad
BLAKE2b-256 09cd2b2a319663c51f80ad878050a9187302ac8488441b6299f36add901fc2d5

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.2-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.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 347681641e6e05ed644501540fa2ce7c8be3d2c2e46668fd7e7d1c5c59c39cc3
MD5 36e487e46edceb5769fa1aceda54c871
BLAKE2b-256 f2f25c99a1e8b40296eb0d1578e4285b562b64ab09d618a55ecd0083be035193

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5a2a23918726f79b0b91526610d2b5c393d534c231fd321df55ff868b1539f95
MD5 56d60942ee2f67ee950e61126fbd5995
BLAKE2b-256 0d97a7b59d908c5dbada1c3163013bde7b7a66716fd096210f418e5187a0a938

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a641d66b7bb109be8de0d7337ff8ced7662b0371a9804576c26c2399a8c23b3e
MD5 a6e33c0064b80d10d765309f8c3a9ace
BLAKE2b-256 fec270186c3ae6a1b553729a3d2952cb122e0a0ca2b2fa26cd24ecfcff749bb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cnrocr-0.3.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 701.8 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c0de6ea02d0e14ca9bb11bc322f5a513319c9ce8f0c635bb8c07454d13ee617b
MD5 a1a009b7b84761d7c7b650a787900fe8
BLAKE2b-256 a7e51b1c71194d1cc6fa6e853b0686c247eae4b9a27c168b5d2e257b134897c4

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.2-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.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 adea756398f9b210d6d5c7bc822a76378b04c09634c10513b4fbd4b811fd6c21
MD5 b6af717c7fca1f682831efc3d2abeeaa
BLAKE2b-256 5ee917dbc7ffe9cca300b916f93941643f68f03dc86631182880dbb6158ba3b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 baa0497d53f23d99af353c5716625b7770890159cd69593f5c75258ce081f6e1
MD5 e6d36845d91bf24b8fbd87784f97094b
BLAKE2b-256 45144e182c7c2acfc9fecec0b3b01fef6feac12e764720807ee0f43ec53bd30d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e926bdd98d0dae7c3267a1013a917b7ab5f8fe34b65d58320b18a07d165b7084
MD5 a804948e4662d211f1b3a7ee9c5d6721
BLAKE2b-256 e5902cd599b270c65fe4568f43134e9c58087890c58d159e9fc83a70da8a1b66

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

This release

0.3.2 This release

16 files

0.3.1

16 files

0.3.0

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