Conversation
Codecov Report
@@ Coverage Diff @@
## master #490 +/- ##
==========================================
+ Coverage 89.07% 89.12% +0.05%
==========================================
Files 37 37
Lines 2562 2566 +4
==========================================
+ Hits 2282 2287 +5
+ Misses 280 279 -1
Continue to review full report at Codecov.
|
|
Sorry for missing this PR. It would be good to minimize the overhead to convert the data back and forth. As of your suggestion, I think passing "string arg for image" might conflict with the usage of caffe2 blob name (use string to index tensor). I would suggest using What do you think? |
This is inspired by #21, which wants a way to easily add a PNG as an image summary. The examples demonstrate how to do this.
FWIW I think this example is a very reasonable feature addition:
The rationale for closing #21 was that this sort of encoding is best left to the user. I disagree based on the following:
tensorboardX already uses a PIL.Image instance to encode a numpy array to PNG bytes
If given a PIL.Image instance, tensorboardX can skip the step of generating one from the numpy array (this is shown in the example)
If given a string value as the second argument to
writer.add_image, tensorboardX can trivially callPIL.Image.openand use that image instance to encode the PNG bytes for the summaryThis PR is valid as a stand-alone example, but I also hope it makes the case to support the following enhancements to
writer.add_image:PIL.Image.openI'm happy to implement those changes in another PR but I wanted to start this discussion with an example (useful in its own right).