Image Annotations

Annotators for extracting high-level metadata about the images in the input.

The annotator implemented here finds simple metadata, such as high and width, of the input images. Particularly useful when using the ImageInput annotator.

class dvt.annotate.img.ImgAnnotator(**kwargs)[source]

Bases: dvt.abstract.FrameAnnotator

Annotator for grabbing metadata about the images in the batch.

freq

How often to perform the embedding. For example, setting the frequency to 2 will computer every other frame in the batch.

Type:int
frames

An optional list of frames to process. This should be a list of integers or a 1D numpy array of integers. If set to something other than None, the freq input is ignored.

Type:array of ints
name

A description of the aggregator. Used as a key in the output data.

Type:str
annotate(batch)[source]

Annotate the batch of frames with the image annotator.

Parameters:batch (FrameBatch) – A batch of images to annotate.
Returns:A dictionaries containing the height and width of the input images.
name = 'img'