tensorflow / lucid

A collection of infrastructure and tools for research in neural network interpretability.
Apache License 2.0
4.65k stars 655 forks source link

save show(VIS) to .jpeg #293

Closed 400lbhacker closed 3 years ago

400lbhacker commented 3 years ago

I did get this working awhile ago, where I was able to write show(VIS) directly to an image file(.jpeg) . but I lost my source code. I rerember trying with PIL and CV2 but dont rerember which one is the one that did end up working.

for example by default the examples simply display the output once finished, but does not save it to a file.

-------

vis = render.render_vis(model, objective, param_f=param_f, thresholds=[512], verbose=False, print_objectives=[content_obj, style_obj])[-1]

show(vis)

------

I want to modify the above to also save vis to physical img. But the array format is tricky

colah commented 3 years ago

You want to use lucid.misc.io.save