I'm looking for a way to calculate image similarit...
# getting-started
s
I'm looking for a way to calculate image similarity in Kotlin using cosine similarity. Does someone know a lib where this algorithm has already been implemented? The next best thing I was able to fnd is only a image hashing algorithm in Java which I could rewrite in Kotlin using skija. As far as I understood the cosine similarity algorithm has better results than image hashing, but I'm unfortunately now even able to find a Java implementation of this.
s
You need to use a model to get image embeddings from it and then do cosine similarity on those embeddings. Image embeddings provide the insights into feature space of an image
I've done that for face similarity using facenet model
s
Thanks. With ML this takes quite long. I now use the pHash algorithm. JImageHash has a implementation of that.
198 Views