vikus-viewer icon indicating copy to clipboard operation
vikus-viewer copied to clipboard

Starting on the tsne view

Open MNoichl opened this issue 1 year ago • 9 comments

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?

MNoichl avatar May 01 '23 15:05 MNoichl

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 avatar May 01 '23 15:05 cpietsch

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.

cpietsch avatar May 01 '23 16:05 cpietsch

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

MNoichl avatar May 03 '23 13:05 MNoichl

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 avatar May 03 '23 13:05 cpietsch

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

cpietsch avatar May 08 '23 16:05 cpietsch

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

MNoichl avatar May 08 '23 23:05 MNoichl

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

MNoichl avatar May 11 '23 14:05 MNoichl

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 avatar May 23 '23 07:05 cpietsch

@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.

cpietsch avatar Aug 26 '23 12:08 cpietsch