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

Uploaded CPython 3.13Windows x86-64

cnrocr-0.3.1-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.1-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.1-cp313-cp313-macosx_11_0_arm64.whl (722.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cnrocr-0.3.1-cp312-cp312-win_amd64.whl (687.3 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

cnrocr-0.3.1-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.1-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.1-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.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cnrocr-0.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 682.0 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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 41224ce41a9a73d792a3bf2c23bfdc1cbee06b6699b8ccd3f05e4ddd0aa078dd
MD5 d085f4405a8d6bd091c69cda99817af1
BLAKE2b-256 190a673364f61c658303d1e2865f497a01bd0d35c4d93b3b14b3977547f91675

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.1-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.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5a7c04dcad444892db35375797d3efada6901e9f07028ac11043b53577e0fff9
MD5 f61af123563625ffb25e51d12b272325
BLAKE2b-256 c7309c69f99eb37c81ed08c70c5db3e56cbfddead79aa3d68fa88d6adf4fc394

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 de3371a779c4be64bbfb0a49e42a2ded0a0a2b269b09d8ce5539731fcc2afdfb
MD5 facbe628c16cdbc95b3ad4934c12fbea
BLAKE2b-256 5e6848e0f93ec28b1ba6d7a413186d9aadf56576fb643fcdc27cec50a7ce38bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d540dc24655aebf760a65373275ec0d013a12a80689b21b7c8884adad62db63
MD5 0671980bb9bf6dece71669ecd41b5f91
BLAKE2b-256 f9eafe595d6c9d14081f6f3fbbb6105a0706226685adc568b78468804f37153d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cnrocr-0.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 687.3 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2938858234f4e30530464140b37db3e63122f531361a55720ddb5562a7ca9e4d
MD5 8759f397414cac8fc2533a21ad4d7025
BLAKE2b-256 19c073955977867157250707079719f8a73f8d18c7aba1fe45a4628c195dc500

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.1-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.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e2fd04bb1395d8fb73aef57b78026e80b532cb01f336609db38b40f73d4d213
MD5 387ef0eee3680bb66d8b09e08759d096
BLAKE2b-256 4cb62f4c63147698f63b658b1cf45b1d101ddcde08d4a28b1300da9934a837e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ba8466cec9f983ea654795c48a3805c0c367e7406585c6bd87f2c2c206d9d5e5
MD5 f4f4cc9b13af1827895720616c59a277
BLAKE2b-256 a7bc9ada46c40a0f40b8d4891e182ed8e6fc0a9a48ae6b386a9bd1c17b2a80b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7bf9326568463ececa2b50eb8ddb8062dad42b3ec7f41631ba12d4faa3b46db7
MD5 682aedd371d1e0b362f1eb0c598f3f48
BLAKE2b-256 74ff815c0cfeb0cc7136e8929b228d3d174cc4014263872b8d1133753e34bed1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cnrocr-0.3.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 283546f7ff0cc5315c35dcaeb33debb26f0987b17d8c7616fd89a895f6059ffb
MD5 42a952eaabeb8541760137818cac6674
BLAKE2b-256 9f051a56f6f5e5c2289b761e61a6f822df4c61ae44e780ff4927a969fb178658

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.1-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.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6bf62b0b27e5b215a67ff209a34d7dae73c347895f08fb827b0951d6f061a73
MD5 53e1b3e4891ed69959764852d9e89be2
BLAKE2b-256 8032e8fa31baea96a54720c8f31117f03bf09b23859dbb2ba837aa63e4b6addf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b3df0ae909fe081b625970ee88e8d955d330c29081e11d6737e82ce73da4ed74
MD5 5cfc9cd9e8f9b29d5a8b6cd0ccf7ca27
BLAKE2b-256 2d04209140861d157086748abf4acb1177a79cc6c17dfccc77554d2b09e5be62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 904da9c40c6f58fdd2248537c94160ab0156dd34ac617f3ae653efd45ab04bed
MD5 be3d718e8ca2424a6fb6017b8aba94bf
BLAKE2b-256 4bb3aa1c0c9f47c9ce54bf507deb08c66a4c3a8044efde8bac871231a5799f76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cnrocr-0.3.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9bc9e26321c262b43238a9bb2117223878f68c98641d186f7530c96e08343b1c
MD5 f7348a22302d51fa743cb7deafca3e63
BLAKE2b-256 f50d2710bc61e70e624522d8eacec92aa7b5b1261f57654b7b2ba8b53e1eeb85

See more details on using hashes here.

File details

Details for the file cnrocr-0.3.1-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.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b634e977b27bdf75577844bb75c3e7c2430401b954c8b0cea45440197db2220e
MD5 d9fa07a9788dd1ead38c140385b55b67
BLAKE2b-256 66072c8cce60a7fde732e7a75c511d141a23eb4f98363f339b0463159255f57d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3a08a3f794931dd5323323eeeb94cddee4fe956386af54e51b76a9f24c34401a
MD5 9c2376e82369977d3be3618b3d324316
BLAKE2b-256 a0b528e39288f7e2664ba575269b70e4d2dac30300923ce0180651baa646a74a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cnrocr-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecbd43206bd48cc7c9d169f78464a21ac3f8089c1bf20cbe95aaaeb0fcf3ddfc
MD5 5eb16e32e332b1f0dd0a30b75f45f008
BLAKE2b-256 fd93366cfe7e8a1890ceebc813daf9365d3ec23d1e11035b610086a8f33cf447

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

This release

0.3.1 This release

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