Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Want to use it for the ReID model embedding visualisation #395

Open
senhorinfinito opened this issue Jan 16, 2024 · 1 comment
Open

Want to use it for the ReID model embedding visualisation #395

senhorinfinito opened this issue Jan 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@senhorinfinito
Copy link

I wanted to visualise the ReID dataset, here is steps I wanted to implement,

  1. I have csv file which contains the columnA as image_name and column B has the feature vector of [1, 512] I wanted to visualise it
    like I saw for the classification, similarity score should be cosine.

How I can do it, can I contribute in developing it

@senhorinfinito senhorinfinito added the enhancement New feature or request label Jan 16, 2024
@druzsan
Copy link
Collaborator

druzsan commented Feb 1, 2024

Hi @senhorinfinito,I apologize for the late response.

The both steps you need are implemented already:

  1. To load a CSV file first ensure that embeddings are saved as they are expected by Spotlight, e.g.:
image,embedding
path/to/img.jpg,"[0.1, 0.2, 3.1415926535]"
https://path.to/img.jpg,"[0.2, 0.3, 0.4]"

(small example file). Both image paths and URLs are supported natively.

Now, you have two options to load your CSV file into Spotlight:

  • CLI:
spotlight path/to/dataset.csv

or Python/ipython/Jupyter Notebook:

import pandas as pd
from renumics import spotlight

df = pd.read_csv("path/to/dataset.csv")
spotlight.show(df)

Spotlight starts in a browser automatically. So if you see Similarity Map widget at the top-right corner filled with points, it is a sign that your embeddings are recognized correctly. At the click at a row you should see images in the bottom Inspector widget.

  1. Now click at the gear icon in the Similarity Map widget to open the settings. In the Metric input, choose cosine (s. attached image).
    Screenshot 2024-02-01 at 15-47-25 Spotlight (mnist-tiny csv)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants