joshterrill 6 days ago

I'm curious how you're implementing the image similarity matching. I recently reverse engineered the Apple Neural Hash model and wrote an API to use it in my app for doing image similarity calculations. I found it to be extremely quick compared to some of the other more computationally intensive methods that I was trying to use before.

1
correa_brian 6 days ago

We're using redis vector modules for cosine similarity. I'm sure there's more to optimize there. Your project sounds cool. How'd you reverse engineer apple's model?

joshterrill 2 days ago

I extracted the espresso model files from a recent iOS build and then wrote a python script to unpack the weights and save them in an open source format that is easier to work with, in my case it was onnx. Through many rounds of iteration, I converted each neural network layer from espresso to its onnx equivalent and eventually got something that works, then turned it into an API. If you want me to send it to you, let me know! My GitHub username is the same username I have on here, and on my GitHub you’ll find my email.