Skip to content

dvclive.log: Support images #150

@daavoo

Description

@daavoo

Now that dvc has support for logging images, it makes sense to also add support on the dvclive side.

A few questions arise:

dvclive.log or dvclive.log_image

Should the existing dvclive.log method be extended to accept a new input type (Image-like) or should we add a new separate method ?

For reference:

  • wandb has a single log method that handles every type.
  • CometML has a separate log_image
  • MLFlow uses a separate general method log_artifact
  • Neptune has a single log method that can receive images (File.as_image).

Valid inputs

What kind of objects should be accepted to log as images? How would be handled by dvclive?

On the dvc side, the only condition is that the image is stored in a valid format .

On dvclive we should consider what we will accept as inputs and how to handle them.

The more common Image-like objects I can think of are:

  • 2D/3D array/tensor (i.e. Numpy, PyTorch)
  • Pillow Image
  • Matplotlib Figure

In addition we need to consider if we want to also accept a string indicating a path to an existing image file (i.e. dvclive.log_image("foo.png")), for cases where the user takes care of saving the image by itself.

Metadata

Metadata

Assignees

Labels

discussionrequires active participation to reach a conclusionfeature requestp1-importantInclude in the next sprint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions