lookalike
Multi-axis visual similarity detector to prevent lookalike game levels.
Full-room visual identity checker that compares every pair of level screenshots or composites across DINOv2 semantics, edge structure, route geometry, saliency, and Lab palette to flag lookalike rooms.
git clone https://github.com/BestRoiMedia/bestroi-game-tools.gitWhy we built it
A different background file or recolored palette does not make two rooms feel distinct to a player. We built lookalike to enforce architectural silhouette, focal feature, and route variety across large campaigns before rooms ship.
Architecture & how it works
lookalike.py automatically masks static HUD/button regions across screenshots, then scores every room pair on five axes: DINOv2-base semantic cosine, mirrored-invariant edge-orientation and luminance structure, tile-grid route geometry, spectral-residual saliency layout, and Lab k-means palette transport. It flags LOOKALIKE, SAME_SCENE, NEAR_LOOKALIKE, and SET_OUTLIER pairs and renders ranked pair comparison sheets.
Key capabilities
- Five-axis similarity scoring combining DINOv2 semantics, edge structure, route, focal, and palette
- Automatic static HUD and letterbox detection and inpainting on native screenshots
- Mirrored-layout invariance so flipped rooms do not evade structural checks
- Supports generic room PNGs plus optional tile/entry/exit JSON for route scoring
- Generates ranked pair sheets, full-campaign scale grids, and raw pairs.json metrics
Usage example
python3 lookalike/lookalike.py compare ./shots/*.png --rooms-dir ./data/rooms --out ./out/lookalike