Image
2 minute read
Format images for logging to W&B.
Args | |
---|---|
data_or_path |
(numpy array, string, io) Accepts numpy array of image data, or a PIL image. The class attempts to infer the data format and converts it. |
mode |
(string) The PIL mode for an image. Most common are “L”, “RGB”, “RGBA”. Full explanation at https://pillow.readthedocs.io/en/stable/handbook/concepts.html#modes |
caption |
(string) Label for display of image. |
Note : When logging a torch.Tensor
as a wandb.Image
, images are normalized. If you do not want to normalize your images, please convert your tensors to a PIL Image.
Examples:
Create a wandb.Image from a numpy array
Create a wandb.Image from a PILImage
log .jpg rather than .png (default)
Attributes |
---|
Methods
all_boxes
all_captions
all_masks
guess_mode
Guess what type of image the np.array is representing.
to_uint8
Convert image data to uint8.
Convert floating point image on the range [0,1] and integer images on the range [0,255] to uint8, clipping if necessary.
Class Variables | |
---|---|
MAX_DIMENSION |
65500 |
MAX_ITEMS |
108 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.