A script to create an organized tableau from an image collection using unsupervised learning
Just pass a folder with the collection of images and it will generate one image with all thumbnails spatially organized.
Example with ~12000 images (resized)
Example with ~200 images (resized)
- Install Conda https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
- Clone this repository.
- Change to repo directory:
cd collectionview
- Prepare the environment using:
conda env create -f collection_view.yml
- Activate the environment with:
conda activate collection_view
- Run the python script and pass a directory (subfolders are ok):
python collection_view.py my_dir
- The image will be created one directory above the image directory.
-h, --help
show this help message and exit
--width WIDTH
width of final image
--height HEIGHT
height of final image
-t THUMBWIDTH, --thumbwidth THUMBWIDTH
width of each thumbnail in the final image
-m {vgg16,vgg19,resnet50}, --model {vgg16,vgg19,resnet50}
choice of feature categorization model
-i SAVEIMAGE, --saveimage SAVEIMAGE
name of image to be saved
-f SAVEFEATURES, --savefeatures SAVEFEATURES
name of file to store the extracted features
-rp RANDOMSTATE_PCA, --randomstate_pca RANDOMSTATE_PCA
PCA randomstate integer. repeat to obtain the same results
-rt RANDOMSTATE_TSNE, --randomstate_tsne RANDOMSTATE_TSNE
TSNE randomstate integer. repeat to obtain the same results
- Load features saved in the pkl file
- Clustering
- Clustering with voronoi borders
- Clustering with size weight
- Mosaic organization instead of scatter