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, text='')[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

textstr

Optional prompt carried alongside the image, populated by ImageAssembler from its textCol. Used by annotators that take a text instruction with the image.

annotatorType[source]#
origin[source]#
height[source]#
width[source]#
nChannels[source]#
mode[source]#
result[source]#
metadata[source]#
text = ''[source]#
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