mvkit
Machine vision inspection for production lines — a framework you install, not a library you call.
mvkit runs an unattended inspection loop: wait for a trigger, grab a frame,
run an inspection chain, report the verdict to the line, repeat. Cameras,
triggers, result sinks and inspection modules are all plugins, so a new site is
a configuration change rather than a code change.
No PyTorch in the default install. The runtime is onnxruntime + numpy +
opencv.
Install
pip install mvkit # CPU
pip install "mvkit[gpu]" # NVIDIA CUDA via onnxruntime-gpu
pip install "mvkit[genicam]" # GenICam/GenTL industrial cameras
On GPU, upgrade with --no-deps. onnxruntime and onnxruntime-gpu ship the
same onnxruntime module and overwrite each other. onnxruntime (CPU) is a core
dependency, so a plain pip install -U mvkit pulls it back in and you silently drop
to CPU:
pip uninstall -y onnxruntime # after installing mvkit[gpu], keep one build
pip install -U --no-deps mvkit # upgrades from now on
mvkit doctor reports this state and prints the way back.
Then:
mvkit serve # http://127.0.0.1:8000 — dashboard and REST API
mvkit doctor # what is installed, what is missing, and why
The dashboard opens on a demo file camera reading the bundled sample images, so a fresh install has something to look at before any hardware arrives.
What it does
| Layer | Plugins |
|---|---|
| Cameras | file · opencv (webcam, RTSP) · watch_folder · harvester (GenICam) |
| Triggers | hardware · digital_input · software · interval · push |
| Result sinks | digital_output · modbus_tcp · log — several at once |
| Inspection | see below |
The runtime keeps capture, inference and dispatch on separate threads with bounded queues, so a slow PLC never stalls inference and a fast line never silently piles up frames. Camera drop-outs reconnect with backoff; a watchdog heartbeat tells the line when the inspector itself has stopped.
Inspection modules
| Module | What it checks | Weights |
|---|---|---|
barcode |
1D barcodes, QR, DataMatrix | none |
presence |
part present / missing, by template | none |
count |
number of objects | none |
color |
colour deviation (Lab ΔE) | none |
patchcore |
surface defects — teach from 5–10 good parts | DINOv2 (ONNX) |
crane |
surface defects, zero-shot | CLIP + DINOv2 (ONNX) |
detect |
object detection | D-FINE (ONNX) |
detect_gate |
detect a region, then inspect only that region | D-FINE (ONNX) |
ocr |
text reading — needs mvkit[ocr] and PyTorch |
EasyOCR |
schad |
structural + logical anomalies — needs mvkit[train] and PyTorch |
trained on your machine |
Model weights are not bundled in the wheel. They are downloaded per module on first use, or imported from a disk:
mvkit models download --module patchcore
mvkit models import D:\mvkit_assets
mvkit models status
Teaching a part
Upload five to ten good samples in the dashboard; no defect images are required and no labelling is involved. The result is stored on your machine and never leaves it, and a product folder can be copied to another machine as it is.
Teaching from the command line is not available yet.
What needs to be installed separately
Two things cannot come from PyPI.
Industrial camera SDKs. harvesters talks to a GenTL producer (.cti), and
that file ships with the camera vendor's runtime — Basler pylon, Hikrobot MVS,
Teledyne FLIR Spinnaker, and so on. Install the vendor runtime and mvkit will
find the producer on its own. Order does not matter; the search happens when a
camera is opened, not at install time.
PyTorch, for mvkit[ocr] and mvkit[train] only. PyPI metadata cannot
express which CUDA build you need, so install it yourself first:
pip install torch --index-url https://download.pytorch.org/whl/cu128
pip install "mvkit[train]"
mvkit doctor reports both, and distinguishes "not installed" from "broken".
Where things are stored
| Location | |
|---|---|
| Model cache | %LOCALAPPDATA%\mvkit\Cache · ~/Library/Caches/mvkit · ~/.cache/mvkit |
| Products, teaching results, logs | %LOCALAPPDATA%\mvkit\artifacts · ~/Library/Application Support/mvkit/artifacts · ~/.local/share/mvkit/artifacts |
| Site configuration | %APPDATA%\mvkit\site.yaml · ~/.config/mvkit/site.yaml |
A product folder is self-contained: copy it to another machine and inspection works there. Retraining caches live outside it and can be deleted.
Line PCs often have a small system drive. mvkit doctor prints the artifacts
path with free space; move it with mvkit config set artifacts_dir D:\....
Evaluation
All modules are available for three months. After that, barcode,
presence, count and color keep working; the rest need a licence.
An expired licence never stops a running line. Inspection in progress continues; only starting a new run and teaching new products are blocked, and the dashboard warns 30, 7 and 1 days ahead.
Your teaching results are yours. They are not deleted when a licence expires and can always be exported.
For a licence, email pashidl.lab@gmail.com with your name, organisation and intended use.
License
Proprietary. Evaluation and non-commercial research use only — see LICENSE.
Contact the copyright holder for commercial licensing.
Metadata
Release files for mvkit 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mvkit-0.4.3-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
Release files / mvkit-0.4.3-cp311-cp311-win_amd64.whl
| Download URL | mvkit-0.4.3-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
110023600ee2fdee2805aaf1c5b8aafd1a9117177b327847b30c7785f5a0af9b
|
|
BLAKE2b-256 checksum How to use checksums |
4f41142643f4f664fbd03b8199746e0c6c4079d6976cff816c4d405228bedff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency log