# Best model for image object comparison?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbest-model-for-image-object-comparison%2F154079%3E%5C
**Category:** Models\
**Created:** [May 8, 2025, 8:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbest-model-for-image-object-comparison%2F154079 "2025-05-08T08:21:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qarpkk](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/qarpkk/32/47125_2.png) [@Qarpkk](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FQarpkk)%5C
**Post date:** [May 8, 2025, 8:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbest-model-for-image-object-comparison%2F154079%2F1 "2025-05-08T08:21:39Z")

</div>

Hello,

What are the best models for comparing objects on two images? Both images will have one primary object, for example a bike. So imagine having two images of the same bike, but taken with different backgrounds, different angles, different lighting etc.

So the model should try to ignore everything else than the main object, and then compare them and give a similarity score of 0-100%.

Thanks in advance for your inputs 🙂

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 9, 2025, 4:50am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbest-model-for-image-object-comparison%2F154079%2F2 "2025-05-09T04:50:14Z")

</div>

Image similarity task?

> **[Image Feature Extraction](https://huggingface.co/docs/transformers/main/en/tasks/image_feature_extraction#image-similarity-using-image-feature-extraction-pipeline)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Image Similarity with Hugging Face Datasets and Transformers](https://huggingface.co/blog/image-similarity)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Serverless Image Similarity with Upstash Vector and Huggingface Models,...](https://huggingface.co/blog/omerXfaruq/serverless-image-similarity-with-upstash-vector)**
>
> A Blog post by Ömer Faruk Özdemir on Hugging Face

---

<div class="post-metadata">

**Author:** ![Qarpkk](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/qarpkk/32/47125_2.png) [@Qarpkk](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FQarpkk)%5C
**Post date:** [May 9, 2025, 2:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbest-model-for-image-object-comparison%2F154079%2F3 "2025-05-09T14:37:41Z")

</div>

I have played around with multiple of those. The issue is that they compare the whole image.

Imagine having two images, both having the same solid color on the left half..  
On the right half the first image has a bike. On the right hand of the second image there’s a dragon.

This should be 0% match. But all those I tried, would give at least 50% match, because the left half are identical on both images.

I want it to be recognise the main object on both images and only do a comparison between those.

Is the only way around it to handle it in multiple steps? Like, removing the backgrounds, reading objects, identify which one I want and then compare those? I feel like there’s already someone who built something to handle those use cases.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 9, 2025, 11:24pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbest-model-for-image-object-comparison%2F154079%2F4 "2025-05-09T23:24:50Z")

</div>

Hmm, I agree that separating the processing would be more reliable. It depends on which object to designate as the main object. If you want to use a single model, I think the CLIP model would be the closest approach, but it would be difficult to obtain a score using this method.

> **[GitHub - cobanov/clip-image-similarity: Simple image similarity calculator using the CLIP](https://github.com/cobanov/clip-image-similarity)**
>
> Simple image similarity calculator using the CLIP
