We’ve been creating these mosaics for decades...
We’ve been creating these mosaics for decades...
But yes the photomosiacs strictly don’t use ML, unless you count the internal fun stuff Faiss (the similarity search lib) does to construct fast indexes.
[1] https://github.com/worldveil/photomosaic/blob/master/emosaic...
As to why it was in the project: If you treat each pixel as an example vector in 3 dimensions and cluster, you get the “dominant” colors for the image. It’s a primitive way to compress images as well. In this case I just was using it to generat fun cards that would use a minimal number of dominant colors. It’s still in the code if you’d like to use it but a bit hidden.
K-means, clusters on centroids that are means. After every interation new means are calculated and then reclustering occurs.
As I mentioned above the only ML is the face classifier. There’s a flag that allows you to only include face pics in the photomosaics as well