$ show yurijmikhalevich/rclip
rclip is a command-line semantic photo search tool that indexes local image collections using a CLIP model (OpenCLIP ViT-B/32-256) and supports natural-language, image-to-image, and combined queries with boolean operations. The core architecture is monolithic: a Python package with modules for model inference (ONNX/CoreML), SQLite-based feature caching, image preprocessing, and a Textual terminal user interface for interactive browsing. It is fully offline and privacy-preserving, supporting a wide range of image formats including HEIC, raw (CR2, DNG, ARW), and standard web formats. The tool is distributed via PyPI, Snap, AppImage, Homebrew, and Windows MSI, with careful compliance management for third-party licenses, codecs, and model artifacts. It includes an extensive test suite (unit and end-to-end), CI/CD via GitHub Actions, and a compliance toolkit that enforces license policies during builds. The codebase is well-structured and demonstrates good engineering practices, though it relies on a pinned version of textual-image that uses a private API, introducing some technical drift risk.
The LLM identified 4 files worth highlighting for reuse:
Implements the CLIP image preprocessing pipeline entirely with PIL and NumPy, matching the open_clip transforms without requiring PyTorch. This makes it reusable for any CLIP-based image analysis project that uses ONNX or CoreML inference, eliminating the need for a heavy deep learning framework at inference time.
Provides an AggregatedProgressBar class that combines multiple tqdm progress bars (e.g., from concurrent downloads) into a single aggregated progress display. This is a clean, reusable utility for any CLI application that needs to show combined download progress.
A vendored and self-contained CLIP BPE tokenizer implemented in pure Python. It parses the CLIP vocabulary and merges files, performs byte-pair encoding, and pads/truncates to the model's context length. This tokenizer is a critical, reusable dependency for any CLIP-based project and is provided with a permissive MIT license.
Implements a policy-driven license verification system that checks third-party licenses against a user-defined policy file (policy.toml). It automatically collects licenses from dependencies, verifies allow/deny lists, and can augment CycloneDX SBOMs. This pattern is reusable for any Python project that needs to ensure legal compliance in distributed artifacts.