szym / display

Lightweight browser-based display server
MIT License
212 stars 46 forks source link

feature request: saving plots to file #27

Open superphil0 opened 8 years ago

superphil0 commented 8 years ago

Hi, I would like to be able to save a plot that gets updated every x seconds to a file (overwriting the old version) this would be really great to make sure to not loose the plots of my experiments which run for days only because my client lost connection to the server where i am training.

If you could give me a hint on how to do this (as an option) I could come up with a pull request.

Wakeupbuddy commented 8 years ago

+1 this seems a useful feature

szym commented 8 years ago

Agreed it's a good idea. I'll add save-to-svg for plots.

ili3p commented 8 years ago

But for svg plots, you can right-click on the plot and there is save image option already. At least on mac using chrome and firefox.

Edit:

Sorry, I misread, you want to automatically save every plot as it gets updated to file.

szym commented 8 years ago

@ilija139 I'm on OSX and in both Chrome and Firefox I only have the option to save the image as PNG but the result is a blank image (although of the correct size). I broke out #33

@superphil0 One option would be to keep a queue of events in the server for as long as there is no client connected. It'd be difficult to guarantee that the events are actually delivered, but that only matters at the very moment the client gets disconnected.

Another option is to make sure the client sending images keeps a copy of them for as long as you might want to have access to them. For example, in addition to display.image(im, ...) store a global copy of the image and do not exit the process until user input. Then upon user input (when you return to check on the experiment) you could refresh the image from memory.

Generally speaking however, if the results matter to you, you should be saving them locally. display was designed for interactive work.