How 27aran/objecttwin works
ObjectTwin is an image-similarity search tool: the current implemented workflow is a user invoking the CLI with a reference image and folder, then receiving ranked matches. Search recursively discovers images, loads and normalizes them, and compares DINOv2 embeddings. TIFF handling and automatic CPU/GPU selection are supported capabilities. The README describes a GUI, but marks it planned; the packaged entry point currently only prints the version. The graph follows the sampled runtime sources and does not assume the future GUI workflow.
Main entry points: search.py Search and ranking · cli.py Search CLI · embedder.py DINOv2 embeddings · imageio.py Image discovery and loading
Components 8
User interface
- Search CLI
src/objecttwin/cli.py - Package entry point
src/objecttwin/__main__.py
Image intake
- Image discovery and loading
src/objecttwin/imageio.py - TIFF decoding and normalization
src/objecttwin/imageio.py
Similarity engine
- Search and ranking
src/objecttwin/search.py - DINOv2 embeddings
src/objecttwin/embedder.py
Other components
- CLI user
- Pretrained DINOv2 model
Connections 8
- CLI user → Search CLI: provides paths
src/objecttwin/cli.py - Search CLI → DINOv2 embeddings: loads model
src/objecttwin/cli.py - Search CLI → Search and ranking: starts search
src/objecttwin/cli.py - Search and ranking → Image discovery and loading: discovers and loads
src/objecttwin/search.py - Search and ranking → DINOv2 embeddings: embeds batches
src/objecttwin/search.py - Image discovery and loading → TIFF decoding and normalization: decodes TIFF
src/objecttwin/imageio.py - DINOv2 embeddings → Pretrained DINOv2 model: loads pretrained weights
src/objecttwin/embedder.py - Search and ranking → Search CLI: returns ranked matches
src/objecttwin/cli.py