Skip to content
CAI
Software that uses CAICheck a score

cocoa-xu/evision

56.2

Adequate · 17 October 2026

26k

lines of production code

Elixir

with Python, C, C++

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Evision is an Erlang and Elixir library that provides bindings to OpenCV 5.0, enabling image processing, computer vision, and machine learning tasks within the BEAM ecosystem. It features a native Nx backend for high-performance tensor operations, integrates with the OpenCV Model Zoo for pre-trained AI models, and includes tools for GPU memory sharing and interactive notebook development.

How it got here

2021–2022 — Initial release and Nx backend integration

26 changes.

This period marked the initial release of Evision v1.0.0, introducing the first major version with OpenCV 5.0 and a fully functional Nx backend for tensor operations. The work focused on establishing the core Erlang/Elixir bindings, refactoring the binding generator for modularity, and implementing essential features like CUDA support, image display, and comprehensive test coverage. It also laid the groundwork for the Model Zoo by adding pre-trained models for face detection, recognition, and image classification.

2024–2026 — Windows support and binding generator refactoring

4 changes.

This period focused on enabling seamless native dependency resolution on Windows through a new C extension and significantly reorganizing the binding generator into modular config, IR, and emit packages. The refactoring introduced an inheritance-flattening pass and precise argument handling to better support Elixir and Erlang wrappers, accompanied by expanded test coverage for build patches and OpenCV 5.0 compatibility.

Features

Add CRNN text recognition smart cell with PP-OCR V3 support

This change introduces a new text recognition capability via the \Evision.Zoo.TextRecognition\ module, which exposes a smart cell for the CRNN model. Users can now perform image-based sequence recognition using predefined models for English, Chinese, and mixed character sets, including quantized FP16 and INT8 variants. The implementation supports configurable text detectors, specifically allowing the use of PP-OCR V3 models for detection, and handles model initialization, preprocessing, and postprocessing within the smart cell workflow.

_lib/zoo/text\recognition · high confidence

Add CUDA GpuMat pointer conversion and inter-process memory sharing

Users can now convert OpenCV CUDA GpuMat objects to external pointers using three modes: local memory addresses, CUDA IPC handles for GPU-to-GPU sharing across processes, and host IPC shared memory for CPU access. This enables zero-copy data exchange between Erlang/Elixir nodes and external CUDA processes, with the implementation providing the necessary C++ NIF bindings for handle creation, memory mapping, and device ID retrieval.

_c\src/modules · high confidence

Add MobileNet V1, MobileNet V2, and PPResNet image classification models

Users can now classify images using three new pre-trained models: MobileNet V1, MobileNet V2, and PPResNet. These models are available via the \Evision.Zoo.ImageClassification\ module and support both default and quantized variants. Each model provides automatic download and caching of weights and labels, configurable inference backends (defaulting to OpenCV CPU), and a \top\_k\ parameter to retrieve the most likely classification results.

_lib/zoo/image\classification · high confidence

Add PP-Human Segmentation model support to the image segmentation zoo

Users can now perform human segmentation using the PP-Human Segmentation model via the new \Evision.Zoo.ImageSegmentation\ module. This change introduces the \PPHumanSeg\ implementation, which supports both default and quantized model variants that are automatically downloaded from the OpenCV Model Zoo. The module provides functions to initialize the model, run inference on input images, and visualize results with an optional overlay weight, integrating seamlessly with the existing smart cell infrastructure for code generation.

_lib/zoo/image\segmentation · high confidence

Add PP-OCR v3 and DB text detection models to the model zoo

Users can now detect text in images using two new model families: the Differentiable Binarization (DB) model, supporting IC15 and TD500 datasets with ResNet18/50 backbones, and the PP-OCR v3 model, supporting English and Chinese text with standard and int8-quantized variants. These models are available via the \Evision.Zoo.TextDetection\ module, which provides smart cell integration, automatic model downloading, and configurable inference parameters such as image dimensions, thresholds, and backend selection.

_lib/zoo/text\detection · high confidence

Add SFace-based face recognition smart cell

Users can now perform face recognition using the SFace model via a new smart cell in the Zoo. This feature provides configurable parameters for the face detector (YuNet or YuNet Quant), distance metric (Cosine Similarity or L2 Norm), and associated thresholds, allowing for robust face matching and feature extraction.

_lib/zoo/face\recognition · high confidence

Add YuNet face detection model support

Users can now perform face detection using the YuNet model via the new \Evision.Zoo.FaceDetection\ smart cell. This addition provides a lightweight, fast, and accurate face detection capability, allowing users to initialize the model with default or quantized weights, customize parameters like confidence and NMS thresholds, and run inference on images to retrieve bounding box coordinates.

_lib/zoo/face\detection · high confidence

Add pre-commit spell checking hook

A new pre-commit hook has been added to the repository that automatically runs codespell to check for typos in the codebase. The hook is optional and only executes if the codespell tool is installed on the user's system; it skips common build artifacts, dependencies, and generated files to avoid false positives.

.githooks · high confidence

Added HTTP utility module for downloading resources and making requests

A new \Evion.Zoo.Utils.HTTP\ module has been added to provide HTTP functionality for the library. This includes a \download/3\ function that retrieves resources from URLs to local files, supporting proxy configuration via environment variables and displaying a progress bar if the optional \:progress\_bar\ dependency is available. It also includes a \request/3\ function for making generic HTTP requests with configurable timeouts, body content, and redirect handling, utilizing secure SSL options by default.

lib/zoo/utils · high confidence

Added OpenCV Model Zoo integration with backend and target management

The \lib/zoo/zoo.ex\ module introduces a Model Zoo feature that provides utilities for downloading models and managing OpenCV DNN backends and targets. It includes functions to retrieve available backends (OpenCV, CUDA, Inference Engine, TIMVX, VKCOM) and hardware targets (CPU, CUDA, FPGA, OpenCL, Vulkan, etc.), as well as a mechanism to determine which backend-target combinations are actually available on the current system. Additionally, it offers a model download helper that respects XDG cache directory conventions.

lib/zoo · high confidence

Automatic OpenCV and CUDA DLL path resolution on Windows

A new C extension (windows\_fix) is loaded on Windows to automatically resolve and add OpenCV and CUDA runtime directories to the system PATH and DLL search paths at startup. The code detects the CPU architecture (x64 or ARM64), scans for the appropriate Visual C++ runtime bin directory, and updates the environment so that native dependencies are found without manual configuration. For CUDA, it checks the EVISION\_CUDA\_RUNTIME\_DIR environment variable; if set, it adds that path to the DLL search locations, otherwise it prints instructions on how to configure it. This ensures that native libraries load correctly on Windows without requiring users to manually adjust their PATH or environment variables.

_c\_src/windows\fix · high confidence

Evision now supports Nx.Backend for tensor operations

Evision introduces a new \Evision.Backend\ module that implements the \Nx.Backend\ behavior, allowing users to create and manipulate Nx tensors directly backed by OpenCV matrices. This integration enables the use of standard Nx functions (such as \Nx.constant\, \Nx.eye\, \Nx.iota\, and arithmetic operations) with Evision's underlying data structures, facilitating seamless interoperability between the two libraries. The change also includes an \Evision.Application\ module that automatically registers smart cells if the Kino library is available.

lib/evision · high confidence

Expanded Nx.Backend support with new matrix operations

The Evision.Backend now implements a significant set of Nx.Backend callbacks, including element-wise arithmetic (add, subtract, multiply, divide), bitwise operations (and, or, xor, not), comparisons, broadcasting, and mathematical functions (ceil, floor, clip, expm1). It also adds support for cumulative operations (sum, product, min, max), N-dimensional convolution with optimized 2D paths, and matrix utilities like eye and transpose. These additions allow more complex numerical computations to be executed directly on the backend without falling back to Elixir.

_c\_src/modules/evision\backend · high confidence

Initial release of Evision 1.0.1-rc.0 for Erlang

This change introduces the initial Erlang bindings for OpenCV, marking the library's first release for the BEAM platform. The \src\ directory now contains the core application structure (\evision.app.src\) and key modules including \evision\_mat\ for matrix operations, \evision\_highgui\ for window/display functions, and internal helpers for structuring data between Erlang and the underlying NIFs. This establishes the foundational API for using OpenCV features directly within Erlang applications.

src · high confidence

Initial release of evision v1.0.0-rc.0 with OpenCV 5.0 and Nx backend

This release introduces the first major version of evision, upgrading the underlying library to OpenCV 5.0.0 and introducing \Evision.Backend\ as a fully functional Nx backend. The OpenCV upgrade is a breaking change that requires C++17, removes the legacy C API and several deprecated DNN importers (Darknet, Caffe, Halide), and reorganizes modules (e.g., feature detectors moved to \Evision.XFeatures2D\). The new Nx backend implements 72 of 85 \Nx.Backend\ callbacks, enabling \cv::Mat\ to back Nx tensors with support for reductions, sorting, indexing, and elementwise operations, while also fixing N-dimensional broadcasting and scalar arithmetic correctness. Users must now require Nx \\~\> 0.12.1\ and update any code that hardcoded OpenCV type codes or used the removed DNN backends.

(repo-wide) · high confidence

New HighGui and Wx modules for image display and window management

This change introduces \Evision.HighGui\ and \Evision.Wx\ modules, providing new capabilities to display images in GUI windows and manage those windows. \Evision.HighGui\ exposes \imshow/2\, \waitKey/1\, \destroyWindow/1\, and \destroyAllWindows/0\ to interact with OpenCV's high-level GUI functions. \Evision.Wx\ provides a wxWidgets-based implementation of \imshow/2\, \destroyWindow/1\, and \destroyAllWindows/0\, allowing users to view \Evision.Mat\ images in native OS windows. These modules enable users to visualize matrix data directly within their applications.

lib · high confidence

New Livebook SmartCells for ML models and OpenCV Model Zoo

This release introduces a new set of interactive SmartCells for Livebook, allowing users to configure and run machine learning tasks directly in notebooks. The new cells include \Evision: Train Data\ for preparing datasets, \Evision: Support Vector Machine\, \Evision: Decision Tree\, and \Evision: Random Forest\ for training ML models, and \Evision: OpenCV Model Zoo\ for accessing pre-trained models for tasks like face detection and image classification. These cells provide a UI for setting parameters (such as data types, split ratios, and model hyperparameters) and generate the corresponding Elixir code. The \:kino\ dependency is now optional, meaning the library can be used without Livebook, but the SmartCells require \:kino \>= 0.7\ to be registered and used.

lib/smartcell · high confidence

New benchmarking and precompiled NIF fetching tasks

Added two new Mix tasks to the library: \mix evision.backend.bench\ for benchmarking Evision.Backend Nx operations (with options for profiles, iteration counts, and optional Torchx comparison) and \mix evision.fetch\ (replacing the previous \evision.fetch\_precompiled\) for downloading precompiled NIFs and generating checksums for package distribution or local development.

lib/mix · high confidence

New build, download, and verification scripts for OpenCV.js and source acquisition

Added a suite of new scripts to the \scripts/\ directory to support building and verifying a Content-Security-Policy (CSP)-clean \opencv.js\ artifact, as well as acquiring OpenCV source code. \build\_opencv\_js.sh\ orchestrates the Emscripten build with \DYNAMIC\_EXECUTION=0\ and \EMBIND\_AOT\ to remove \eval\ usage, ensuring compatibility with strict CSPs. \verify\_opencv\_js\_csp.mjs\ validates this build by running it under Node's \--disallow-code-generation-from-strings\ flag. Additionally, \download\_opencv.sh\, \download\_opencv.ps1\, \download\_opencv\_contrib.sh\, and \download\_opencv\_contrib.ps1\ provide platform-specific logic to fetch and extract OpenCV and opencv\_contrib sources, while \golden\_diff.sh\ and \inject\_doc\_groups.py\ support regression testing and documentation generation for the Elixir/Erlang bindings.

scripts · high confidence

New example collection for image processing, DNN, and ML tasks

The \examples/\ directory now includes a comprehensive set of Livebook notebooks demonstrating core Evision capabilities. The \README.md\ serves as a catalog for examples covering basic image I/O and manipulation (getting started, QR codes, warping, contours, stitching, PCA, and alpha-channel magic), as well as advanced Deep Neural Network tasks via \Evision.DNN\ (GoogleNet classification, generic object detection, U2Net segmentation/portrait, and DenseNet121 benchmarking). Additional examples showcase Machine Learning with \Evision.ML\ (SVM, Decision Trees, Random Forests), High Dynamic Range Imaging, and a specific Erlang-based DNN video detection demo.

examples · high confidence

Architecture

Refactored binding generator into modular config, IR, and emit packages

The Python source code responsible for generating Elixir and Erlang bindings has been reorganized into a structured package layout (config, ir, emit). This change introduces a canonical depth table (\cv\_depths.py\) to centralize OpenCV depth codes, a Doxygen group scanner (\doxygen\_groups.py\) to map functions to their API categories for better documentation navigation, and a new \@js\ attribute system (\evision\_js\_attr.py\) to tag generated bindings with OpenCV.js correspondences. Additionally, specific struct templates for \Evision.VideoCapture\ and \Evision.CUDA.GpuMat\ are now defined in \evision\_structures.py\, and the main generation pipeline is streamlined through \gen2.py\ and \pipeline.py\ to support these new modular components.

_py\src · high confidence

Reorganized binding generator into config, IR, and emit packages

The binding generator code has been restructured into dedicated \config\, \ir\, and \emit\ packages. This change moves hand-curated mappings for OpenCV types, namespaces, and inheritance policies into the \config\ module, and separates the Elixir and Erlang code generation logic into the \emit\ module. For users, this improves the maintainability of the binding generator, making it easier to add support for new OpenCV releases or adjust type mappings without modifying the core generation logic.

_py\_src/config, py\src/emit · high confidence

Reorganized binding generator into modular IR packages

The binding generator code in \py\_src/ir\ has been restructured into distinct modules (\args\, \classes\, \functions\, \inheritance\, \namespaces\, \props\, \variants\) to improve maintainability. This change introduces an inheritance-flattening pass that copies methods from base classes (such as \Algorithm\, \Feature2D\, and \dnn::Net\) into derived classes, ensuring that inherited methods are correctly emitted for Elixir/Erlang modules which do not support native class inheritance. Additionally, the argument handling logic now distinguishes between input and output arguments more precisely, and function wrappers are categorized as either I/O or CPU-bound for optimized execution.

_py\src/ir · high confidence

Behavioural changes

Add custom C++ headers for Erlang/OTP bindings across multiple OpenCV modules

This change introduces a new set of custom C++ header files in the \c\_src/evision\_custom\_headers\ directory to support the Erlang bindings for various OpenCV modules. These headers provide type definitions, vector converters, and marshalling functions for modules including DNN, CUDA, Barcode, Line Descriptor, Features2D, Flann, Geometry, LineMod, ML, ObjDetect, Phase Unwrapping, PPF Match 3D, Stereo, Stitching, Text, Tracking, UMat, Video, VideoIO, XFeatures2D, and XImgProc. Specific additions include support for \OCRTesseract::runWithComponents\, \NativeByteArray\ for QR code byte data, and compatibility shims for SIFT in \xfeatures2d\. The headers also address build issues by moving typedefs like \dnn\_Net\ and \vector\_Dictionary\ to broader guards to ensure availability in non-contrib builds.

_c\_src/evision\_custom\headers · high confidence

Automated OpenCV patching for cross-platform compatibility and binding fixes

The build system now uses a dedicated Python script to automatically apply source-level patches to OpenCV during compilation. This ensures consistent behavior across all platforms by fixing specific issues: it gates ARM NEON intrinsics (v\_floor, carotene vround) to AArch64 to prevent build failures on 32-bit ARMv8 targets like Raspberry Pi; adds RPATH settings on Linux to ensure shared libraries are found at runtime; enables Python bindings on Android, Apple Frameworks, and WinRT; and adds missing CV\_WRAP annotations to OCRTesseract and DNN layer shape functions so these features are correctly exposed to the Elixir binding layer.

patches · high confidence

Centralized configuration for image rendering and OpenCV.js embedding

The application now uses a unified \config/config.exs\ file to manage runtime behavior. Users can configure automatic type conversion for unsupported data types via \unsupported\_type\_map\, adjust image display limits and encoding for iTerm2 and Livebook (Kino) environments, customize the tab order for Livebook rendering, and opt-in to embedding the OpenCV.js runtime into the application's private assets at compile time.

config · high confidence

Introduce ArgInfo and erlcompat for optimized matrix handling and default argument support

The C++ NIF layer now includes a new \ArgInfo\ structure that tracks argument metadata, specifically adding \has\_default\ and \input\_only\ flags. This enables the binding generator to allow \nil\ for optional parameters and, crucially, to share read-only input matrices instead of deep-copying them, improving performance for functions that only read source data. Additionally, the \erlcompat.hpp\ header provides new \CV\ERL\\*\ macros for type conversions and resource management, replacing older patterns to support these optimizations and standardize how OpenCV types are wrapped and unwrapped in Erlang/Elixir.

_c\src · high confidence

Test coverage

Added test coverage for MLAS patching, OpenCV 5.0 depth codes, and JS arg-plan generation; Added test data for object detection and HDR imaging; Expanded test coverage for DNN, CUDA, Nx backend, and JS runtime.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 56 (-3.5)
  • Rubric changed (rubric-2026.10.1 → rubric-2026.10.5) — scores are not directly comparable.

Lenses

  • Code Health 54 → 50 (-4.1)
  • Architecture 98 → 88 (-10.1)
  • Maturity 59 → 54 (-5.1)
  • Readiness 58 → 58 (+0.0)
  • Security 65 → 65 (+0.0)
  • Performance 100 → 100 (+0.0)

New (123)

  • ClassInfo.init (cognitive 22) (py_src/ir/classes.py)
  • ClassInfo.gen_code (cognitive 40) (py_src/ir/classes.py)
  • ClassInfo.gen_code (cyclomatic 19) (py_src/ir/classes.py)
  • CppHeaderParser.get_dotted_name (cognitive 16) (py_src/hdr_parser.py)
  • CppHeaderParser.parse (cognitive 193) (py_src/hdr_parser.py)
  • CppHeaderParser.parse (cyclomatic 62) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_arg (cognitive 58) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_arg (cyclomatic 42) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_func_decl (cognitive 108) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_func_decl (cyclomatic 67) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_func_decl_no_wrap (cognitive 64) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_func_decl_no_wrap (cyclomatic 34) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_stmt (cognitive 85) (py_src/hdr_parser.py)
  • CppHeaderParser.parse_stmt (cyclomatic 44) (py_src/hdr_parser.py)
  • Duplicated block (10 lines × 2) (py_src/emit/elixir/helpers.py)
  • Duplicated block (10 lines × 2) (py_src/emit/elixir/helpers.py)
  • Duplicated block (10 lines × 2) (py_src/hdr_parser.py)
  • Duplicated block (10 lines × 2) (py_src/ir/variants.py)
  • Duplicated block (11 lines × 2) (py_src/evision_js_attr.py)
  • Duplicated block (11 lines × 3) (py_src/evision_js_attr.py)
  • …and 103 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

cocoa-xu/evision was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 17 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 5b2a5283c6293baf498661dee33a61fd581beee2 — the exact code this score is about.
  • Scored under rubric-2026.10.5 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-fe8540b5da9b.