sparknlp.annotation_image#

Contains the AnnotationImage data format

Module Contents#

Classes#

AnnotationImage

Represents the output of Spark NLP Annotators for image output and their details.

class AnnotationImage(annotatorType, origin, height, width, nChannels, mode, result, metadata)[source]#

Represents the output of Spark NLP Annotators for image output and their details.

Parameters:
annotator_typestr

The type of the output of the annotator. Possible values are IMAGE.

origin: str
  • Represents the source URI of the image

heightint

Image height in pixels

widthint

Image width in pixels

nChannels: int

Number of color channels

mode: int

OpenCV type

resultlist(bytes)

Image data in bytes

metadatadict

Associated metadata for this annotation

copy(result)[source]#

Creates new AnnotationImage with a different result, containing all settings of this Annotation.

Parameters:
resultlist(bytes)

The result of the annotation that should be copied.

Returns:
AnnotationImage

Newly created AnnotationImage