docarray.document.mixins.plot module#
- class docarray.document.mixins.plot.PlotMixin[source]#
Bases:
object
Provide helper functions for
Document
to plot and visualize itself.- summary()[source]#
Print non-empty fields and nested structure of this Document object.
- Return type:
None
- display(from_=None)[source]#
Plot image data from
uri
or fromtensor
ifuri
is empty . :param from_: an optional string to decide if a document should display using either the uri or the tensor field.
- display_rgbd_tensor()[source]#
Plot an RGB-D image and a corresponding depth image from
tensor
- Return type:
None
- plot_matches_sprites(top_k=10, channel_axis=-1, inv_normalize=False, skip_empty=False, canvas_size=1920, min_size=100, output=None)[source]#
Generate a sprite image for the query and its matching images in this Document object.
An image sprite is a collection of images put into a single image. Query image is on the left followed by matching images. The Document object should contain matches.
- Parameters:
top_k (
int
) – the number of top matching documents to show in the sprite.channel_axis (
int
) – the axis id of the color channel,-1
indicates the color channel info at the last axisinv_normalize (
bool
) – If set to True, inverse the normalization of a float32 imagetensor
into a uint8 imagetensor
inplace.skip_empty (
bool
) – skip matches which has no .uri or .tensor.canvas_size (
int
) – the width of the canvasmin_size (
int
) – the minimum size of the imageoutput (
Optional
[str
]) – Optional path to store the visualization. If not given, show in UI