News for hackers. Stuff that matters.
Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by aaaaaaaaaab on Thursday December 13, 2018 @02:48PM (#18675376)
Ok, but where is the ML part?

We’ve been creating these mosaics for decades...

Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by muzakthings on Thursday December 13, 2018 @03:15PM (#18675620)
The face montage building trains a linear classifier on top of the pretrained embedding network - it’s the portion that talks about creating a training folder of your face.

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.

Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by simple10 on Thursday December 13, 2018 @03:07PM (#18675547)
It's using the KMeans[1] library from sklearn.cluster. But this isn't really ML, is it? My ML knowledge is limited. Regardless, it's a cool project. OP might want to update the title to remove ML.

[1] https://github.com/worldveil/photomosaic/blob/master/emosaic...

Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by simple10 on Thursday December 13, 2018 @03:11PM (#18675589)
"[Kmeans] algorithm has a loose relationship to the k-nearest neighbor classifier, a popular machine learning technique for classification that is often confused with k-means due to the name." Maybe an ML expert could elaborate? I've been curious on my own projects when to actually mention when they use true ML or not.

https://en.wikipedia.org/wiki/K-means_clustering

Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by muzakthings on Thursday December 13, 2018 @03:21PM (#18675688)
Right. See my comment above.

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.

Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by _fullpint on Thursday December 13, 2018 @05:32PM (#18676749)
K-nearest neighbor clusters based upon the k most similar objects.

K-means, clusters on centroids that are means. After every interation new means are calculated and then reclustering occurs.

Re:Make photomosaics, GIFs, and murals from pictures in Pyth... by muzakthings on Thursday December 13, 2018 @03:16PM (#18675634)
Naw I had used the Kmeans part for extracting dominant colors. I was thinking about using it to generate cards and using the top K colors for the background of the card.

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