spotlight
spotlight copied to clipboard
Want to use it for the ReID model embedding visualisation
I wanted to visualise the ReID dataset, here is steps I wanted to implement,
- I have csv file which contains the columnA as
image_nameand 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
Hi @senhorinfinito,I apologize for the late response.
The both steps you need are implemented already:
- 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.
- Now click at the gear icon in the Similarity Map widget to open the settings. In the Metric input, choose cosine (s. attached image).