Skip to content

borisgraudt/ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ml

C++ computer-vision playground — Bazel 9 + Bzlmod + OpenCV 5.

ml/
├── app/            # binaries
│   └── ml          # camera preview
├── camera/         # capture + display
└── libs/
    └── opencv/     # system OpenCV → Bazel cc_library

Requirements

Tool Notes
Bazel 7+ (via Bazelisk)
OpenCV 4/5 — brew install opencv
macOS Camera permission for Terminal / IDE

Optional override if OpenCV is non-standard:

export OPENCV_PREFIX="$(brew --prefix opencv)"

Quick start

# build
bazel build //app:ml

# run preview (default device 0)
bazel run //app:ml

# another device index
bazel run //app:ml -- 1

Press q or Esc to quit.

If capture fails with “not authorized”, open
System Settings → Privacy & Security → Camera and allow your terminal.

Layout

Target Role
//app:ml Entry binary
//camera Thin OpenCV capture loop
//libs/opencv Alias to @opencv (system install)
@opencv Auto-discovered via pkg-config / Homebrew

OpenCV is not built from source. A local repository rule finds headers and dylibs and exposes them as a normal cc_library — fast, hermetic enough for local work, and tracks OpenCV 5 from Homebrew.

Tooling

  • C++20 (--cxxopt=-std=c++20 in .bazelrc)
  • clang-format style in .clang-format
  • MODULE.bazel only — no WORKSPACE

About

cpp ml model

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages