https://github.com/pwhiddy/sp-mosaic
https://github.com/pwhiddy/sp-mosaic
clip embedding grid image mosaic sorting tile
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pwhiddy/sp-mosaic
- Owner: PWhiddy
- Created: 2022-05-29T06:15:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-26T06:13:49.000Z (9 months ago)
- Last Synced: 2025-03-17T19:11:37.867Z (7 months ago)
- Topics: clip, embedding, grid, image, mosaic, sorting, tile
- Language: Jupyter Notebook
- Homepage:
- Size: 857 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sp-mosaic
Script to create a mosiac of many images, visually sorted by the first 2 principal components of their CLIP embedding.
More info:
[Creating Mosaics Sorted by Visual Similarity using CLIP Embeddings](https://pwhiddy.github.io/more-writing/2022/05/30/CLIP-Sorted-Mosaics.html)Usage:
```python
from pathlib import Path
import mosaicpath = Path("your/dir/with/imgs")
all_paths = path.glob("*.png")
mosaic.create_mosaic(all_paths, 25, 512, 256, "test_grid.png")
```Example result:
