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

Starting on the tsne view #30

Open
MNoichl opened this issue May 1, 2023 · 9 comments
Open

Starting on the tsne view #30

MNoichl opened this issue May 1, 2023 · 9 comments

Comments

@MNoichl
Copy link
Contributor

MNoichl commented May 1, 2023

Thank's for the great project, I think it's really amazing!

I'm exploring a dataset for which the time-view is not very interesting, and I would like to start off on the tsne-view instead. I was wondering, is there an easy way to accomplish this?

@cpietsch
Copy link
Owner

cpietsch commented May 1, 2023

Thank you @MNoichl !
The current similarity scripts in https://github.com/cpietsch/vikus-viewer-script/tree/master/similarity are a bit outdated, but still could work for smaller collection. Nowadays I use python for the dimension reduction together with CLIP.
If you are interested, I could create and upload a Jupyter Notebook to generate the similarity.csv using python.

@cpietsch
Copy link
Owner

cpietsch commented May 1, 2023

Hey @MNoichl , I just pushed a update that allows you to load multiple layouts into the vikusviewer. Any static layout is possible and is defined via the id and a x,y value.

@MNoichl
Copy link
Contributor Author

MNoichl commented May 3, 2023

Hi @cpietsch, thank you for taking a look, and updating!

Re: timeline – I'm not sure if I'm doing something wrong, but for me, after the updates, vikus-viewer still loads the timeline first, so the user has to do one click to get over to the tsne-view (also clicking back and forth takes much longer now, for some reason). Here's what I put into my config, do I have to do other adjustments for it to work?

      "layouts": [
        {
          "title": "tsne",
          "url": "/maximilian.noichl/full/vikus/data/tsne.csv"
      }

Re: tsne – I'm already using my own openTSNE-coordinates, so I'm good regarding the notebook, but of course that might be helpful for other people. I'm running rasterfairy over the coordinates to get a nice image grid without overlaps, so if you want me to I also could contribute that functionality to it. Of course that messes up the dimres-coords a bit.
image
By the way, what variable do I have to mess with to get larger images on the tsne-view?

Re: canvas.js – I've noticed that after the updates the canvas.projectTSNE-function in canvas.js seems to be duplicated. I don't think this causes issues (?), just flagging.

Thanks,
Max

@cpietsch
Copy link
Owner

cpietsch commented May 3, 2023

Hey @MNoichl, thank you for your support to the project!

Re: timeline
You are doing everything right. I will look into that and make a fix to start with the first layout.

Re: tsne
To get larger images you can fiddle with the scale factor. The https://github.com/cpietsch/vikus-iiif-generator also uses UMAP and Rasterfairy, but relies on an IIIF Collection. Adding an other datasource would be an option or we stick with a small notebook.

Re: canvas.js
Great catch! It must have been a merge mistake. It`s gone now.
I hope this fixes the "(also clicking back and forth takes much longer now, for some reason)"

@cpietsch
Copy link
Owner

cpietsch commented May 8, 2023

Hey @MNoichl, I just pushed the fix. Can you have a try ?

@MNoichl
Copy link
Contributor Author

MNoichl commented May 8, 2023

Great, thank you! I'll give it a go in the coming days, and report back!

@MNoichl
Copy link
Contributor Author

MNoichl commented May 11, 2023

So, finally found a little time – thank you, this works really well now! The viewer starts in the tSNE view, and shifts over to the timeline nicely and smoothly - exactly what I needed, thank you so much!
I noticed, though, that for some reason it still starts with the time label enabled. I'm not sure what's causing this. Another observation I made was that in the tsne-view the images in the closeup are displayed much smaller than in the time-view. I originally assumed 166 in canvas.s would be the place to change that, but for me that doesn't seem to make a difference.

Re: layout – I was experimenting with umap, but I ended up settling on OpenTSNE with high perplexity. It seemed to be more faithful to local similarities, and, more importantly, made use of the space more effectively, as umap tends towards more pronounced clusters. I have a colab lying around, where I ran this, I can clean it up and share it. I think having a data preparation notebook could lower the barrier of entry for others, but I don't know whether you anticipate this to be a problem.

Finally, regarding the scaling – works like a charm!

Cheers,
Max

@cpietsch cpietsch reopened this May 23, 2023
cpietsch added a commit that referenced this issue May 23, 2023
@cpietsch
Copy link
Owner

Sorry for the delay. It would be awesome if you could share the notebook - feel free to add it to the scripts repo.
The scale parameter is now optional and can we tweaked depending on your layout and number of images in the config: {"title": "UMAP", "url": "umap.csv", "scale": 0.8 }.

@cpietsch
Copy link
Owner

@MNoichl I have added a python notebook for UMAP similarity layouts: https://github.com/cpietsch/vikus-viewer-script/blob/master/similarity-python/umap.ipynb
If you are welcome to add yours next to it.

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

No branches or pull requests

2 participants