wandb.data_types.Image
Wandb class for images.
Image(
data_or_path: "ImageDataOrPathType",
mode: Optional[str] = None,
caption: Optional[str] = None,
grouping: Optional[str] = None,
classes: Optional[Union['Classes', Sequence[dict]]] = None,
boxes: Optional[Union[Dict[str, 'BoundingBoxes2D'], Dict[str, dict]]] = None,
masks: Optional[Union[Dict[str, 'ImageMask'], Dict[str, dict]]] = None
) -> None
Arguments
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/4.2.x/handbook/concepts.html#concept-modes.
caption
(string) Label for display of image.
Methods
all_boxes
all_boxes
@classmethod
all_boxes(
images: Sequence['Image'],
run: "LocalRun",
run_key: str,
step: Union[int, str]
) -> Union[List[Optional[dict]], bool]
all_captions
all_captions
@classmethod
all_captions(
images: Sequence['Media']
) -> Union[bool, Sequence[Optional[str]]]
all_masks
all_masks
@classmethod
all_masks(
images: Sequence['Image'],
run: "LocalRun",
run_key: str,
step: Union[int, str]
) -> Union[List[Optional[dict]], bool]
guess_mode
guess_mode
guess_mode(
data: "np.ndarray"
) -> str
Guess what type of image the np.array is representing
to_uint8
to_uint8
@classmethod
to_uint8(
data: "np.ndarray"
) -> "np.ndarray"
Converts 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
Last updated
Was this helpful?