feiyuerenhai
feiyuerenhai

Reputation: 308

Efficient clustering of images using VNFeaturePrintObservation.computeDistance

I'm working with VNFeaturePrintObservation in Swift to compute the similarity between images. The computeDistance function allows me to calculate the distance between two images, and I want to cluster similar images based on these distances.

I'm currently trying a brute-force approach where I compare every image against every other image in the dataset. This results in an O(n^2) complexity, which quickly becomes a bottleneck. With 5000 images, it takes around 10 seconds to complete, which is too slow for my use case.

Are there any efficient algorithms or data structures I can use to improve performance?

If anyone has experience with optimizing feature vector clustering or has suggestions on how to scale this efficiently, I'd really appreciate your insights.

Upvotes: -1

Views: 33

Answers (0)

Related Questions