Class VideoIntelligence
java.lang.Object
org.apache.beam.sdk.extensions.ml.VideoIntelligence
Factory class for PTransforms integrating with Google Cloud AI - VideoIntelligence service.
Converts GCS URIs of videos or ByteStrings with video contents into Lists of
VideoAnnotationResults.
Adding a side input of Maps of elements to VideoContext objects is allowed, so is using KVs of element and VideoContext as input.
Service account with proper permissions is required to use these transforms.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A PTransform taking a PCollection ofByteString
and an optional side input with a context map and emitting lists ofVideoAnnotationResults
for each element.static class
A PTransform taking a PCollection ofKV
ofByteString
andVideoContext
and emitting lists ofVideoAnnotationResults
for each element.static class
A PTransform taking a PCollection ofString
and an optional side input with a context map and emitting lists ofVideoAnnotationResults
for each element.static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionannotateFromBytes
(PCollectionView<Map<ByteString, com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput, List<com.google.cloud.videointelligence.v1.Feature> featureList) Annotates videos from ByteStrings of their contents.annotateFromBytesWithContext
(List<com.google.cloud.videointelligence.v1.Feature> featureList) Annotates videos from key-value pairs of ByteStrings and VideoContext.annotateFromURI
(List<com.google.cloud.videointelligence.v1.Feature> featureList, PCollectionView<Map<String, com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput) Annotates videos from GCS URIs.annotateFromUriWithContext
(List<com.google.cloud.videointelligence.v1.Feature> featureList) Annotates videos from key-value pairs of GCS URI and VideoContext.
-
Constructor Details
-
VideoIntelligence
public VideoIntelligence()
-
-
Method Details
-
annotateFromURI
public static VideoIntelligence.AnnotateVideoFromUri annotateFromURI(List<com.google.cloud.videointelligence.v1.Feature> featureList, PCollectionView<Map<String, com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput) Annotates videos from GCS URIs.- Parameters:
featureList
- List of features to be annotatedcontextSideInput
- Optional side input with map of contexts to URIs- Returns:
- PTransform performing the necessary operations
-
annotateFromBytes
public static VideoIntelligence.AnnotateVideoFromBytes annotateFromBytes(PCollectionView<Map<ByteString, com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput, List<com.google.cloud.videointelligence.v1.Feature> featureList) Annotates videos from ByteStrings of their contents.- Parameters:
contextSideInput
- Optional side input with map of contexts to ByteStringsfeatureList
- List of features to be annotated- Returns:
- PTransform performing the necessary operations
-
annotateFromUriWithContext
public static VideoIntelligence.AnnotateVideoFromURIWithContext annotateFromUriWithContext(List<com.google.cloud.videointelligence.v1.Feature> featureList) Annotates videos from key-value pairs of GCS URI and VideoContext.- Parameters:
featureList
- List of features to be annotated- Returns:
- PTransform performing the necessary operations
-
annotateFromBytesWithContext
public static VideoIntelligence.AnnotateVideoFromBytesWithContext annotateFromBytesWithContext(List<com.google.cloud.videointelligence.v1.Feature> featureList) Annotates videos from key-value pairs of ByteStrings and VideoContext.- Parameters:
featureList
- List of features to be annotated- Returns:
- PTransform performing the necessary operations
-