Class VideoIntelligence
- java.lang.Object
-
- org.apache.beam.sdk.extensions.ml.VideoIntelligence
-
public class VideoIntelligence extends java.lang.ObjectFactory 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 Classes Modifier and Type Class Description static classVideoIntelligence.AnnotateVideoFromBytesA PTransform taking a PCollection ofByteStringand an optional side input with a context map and emitting lists ofVideoAnnotationResultsfor each element.static classVideoIntelligence.AnnotateVideoFromBytesWithContextA PTransform taking a PCollection ofKVofByteStringandVideoContextand emitting lists ofVideoAnnotationResultsfor each element.static classVideoIntelligence.AnnotateVideoFromUriA PTransform taking a PCollection ofStringand an optional side input with a context map and emitting lists ofVideoAnnotationResultsfor each element.static classVideoIntelligence.AnnotateVideoFromURIWithContextA PTransform taking a PCollection ofKVofStringandVideoContextand emitting lists ofVideoAnnotationResultsfor each element.
-
Constructor Summary
Constructors Constructor Description VideoIntelligence()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static VideoIntelligence.AnnotateVideoFromBytesannotateFromBytes(org.apache.beam.sdk.values.PCollectionView<java.util.Map<com.google.protobuf.ByteString,com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput, java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)Annotates videos from ByteStrings of their contents.static VideoIntelligence.AnnotateVideoFromBytesWithContextannotateFromBytesWithContext(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)Annotates videos from key-value pairs of ByteStrings and VideoContext.static VideoIntelligence.AnnotateVideoFromUriannotateFromURI(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList, org.apache.beam.sdk.values.PCollectionView<java.util.Map<java.lang.String,com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput)Annotates videos from GCS URIs.static VideoIntelligence.AnnotateVideoFromURIWithContextannotateFromUriWithContext(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)Annotates videos from key-value pairs of GCS URI and VideoContext.
-
-
-
Method Detail
-
annotateFromURI
public static VideoIntelligence.AnnotateVideoFromUri annotateFromURI(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList, org.apache.beam.sdk.values.PCollectionView<java.util.Map<java.lang.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(org.apache.beam.sdk.values.PCollectionView<java.util.Map<com.google.protobuf.ByteString,com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput, java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)
Annotates videos from ByteStrings of their contents.- Parameters:
featureList- List of features to be annotatedcontextSideInput- Optional side input with map of contexts to ByteStrings- Returns:
- PTransform performing the necessary operations
-
annotateFromUriWithContext
public static VideoIntelligence.AnnotateVideoFromURIWithContext annotateFromUriWithContext(java.util.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(java.util.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
-
-