tensorflow / tensorboard

TensorFlow's Visualization Toolkit
Apache License 2.0
6.71k stars 1.66k forks source link

Add image background for embedding projector #4640

Open hzf1174 opened 3 years ago

hzf1174 commented 3 years ago

I am currently planning to add background image for embedding projector, as I would like to display the decision boundary in 2D space for a given model with the dataset(e.g MNIST). I implemented it by doing this.scatterPlot.scene.background = texture; where texture is a THREE.Texture object. This implementation got two problems:

Any suggestion for the above problems? Especially the second one.

nfelt commented 3 years ago

Hmm - I'm afraid we likely aren't able to provide much guidance here, but it would be easier to possibly do so if you can provide a link to the exact code changes you made and a minimal set of steps / example data to reproduce the issue.

Also, are you planning on this as a local-only modification or was it something you intend to upstream via a PR?

cc @hfiller FYI

hzf1174 commented 3 years ago

@nfelt Here is the link. Basically, the code logic is to get a base64 image bg through the backend server, and then pass it back until updateScatterPlotPositions function in projectorScatterPlotAdapter.ts, then set the value of this.scatterPlot.scene.background. Also, I am trying to add background images for animation(something like what T-SNE is doing), and it seems like the long-time-rendering issue is more serious.

I am currently only planning it as a local-only modification. Looking forwards to your reply.

nfelt commented 3 years ago

Thanks, but I'm afraid we don't really have more insight than you do here, and it's not really scalable for us to provide support for modifying existing visualizations in open-ended ways. My best suggestion is to try to instrument the code to narrow down precisely which part is slow. If you end up finding a specific bug in TensorBoard we'd be happy to consider a PR.