Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Inference request #1

Open
nancvcs opened this issue Sep 23, 2023 · 0 comments
Open

Inference request #1

nancvcs opened this issue Sep 23, 2023 · 0 comments

Comments

@nancvcs
Copy link

nancvcs commented Sep 23, 2023

Thank you for such a detail repo. I have successfully reimplemented it and got the test accuracy 66.7% (I'm happy with that because my dataset is quite big). I want to inference a new single test image to get the most similar image with it (based on lowest contrastive loss) but the result is not similar to the test image at all, even though the test image is compared with just some folders of image, not the whole train dataset, and even though I copied the test image to one of the folders. Can you have a look at my code below? Thank you.

reference_loss = []
pairs_infer = []
img1 = process_image(img_path=test_path)
for i in filename:
  img2 = process_image(img_path=i)
  pairs_infer.append([img1, img2])

y_pred_te = model.predict([pairs_infer[:, 0], pairs_infer[:, 1]])

most_similar_index = np.argmin(y_pred_te)
most_similar_image_path = filename[most_similar_index]
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant