Skip to content

Commit

Permalink
Merge pull request apache#11463 from apache/BEAM-9147-add-experimenta…
Browse files Browse the repository at this point in the history
…l-annotation

[BEAM-9147] Add @experimental annotation to VideoIntelligence related classes
  • Loading branch information
lukecwik committed Apr 20, 2020
2 parents fa4f418 + b8323c8 commit d2089bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.apache.beam.sdk.annotations.Experimental;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.values.PCollectionView;

Expand All @@ -39,6 +40,7 @@
* @param <T> Class of input data being passed in - either ByteString - video data encoded into.
* String or String - a GCS URI of the video to be annotated.
*/
@Experimental
public abstract class AnnotateVideo<T> extends DoFn<T, List<VideoAnnotationResults>> {

protected final PCollectionView<Map<T, VideoContext>> contextSideInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.apache.beam.sdk.annotations.Experimental;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollectionView;

Expand All @@ -37,6 +38,7 @@
*
* <p>Service account with proper permissions is required to use these transforms.
*/
@Experimental
public class VideoIntelligence {

/**
Expand Down Expand Up @@ -88,6 +90,7 @@ public static AnnotateVideoBytesWithContext annotateFromBytesWithContext(
* Implementation of AnnotateVideo accepting Strings as contents of input PCollection. Annotates
* videos found on GCS based on URIs from input PCollection.
*/
@Experimental
public static class AnnotateVideoFromURI extends AnnotateVideo<String> {

public AnnotateVideoFromURI(
Expand All @@ -114,6 +117,7 @@ public void processElement(ProcessContext context)
* Implementation of AnnotateVideo accepting ByteStrings as contents of input PCollection. Videos
* decoded from the ByteStrings are annotated.
*/
@Experimental
public static class AnnotateVideoFromBytes extends AnnotateVideo<ByteString> {

public AnnotateVideoFromBytes(
Expand Down Expand Up @@ -141,6 +145,7 @@ public void processElement(ProcessContext context)
* Implementation of AnnotateVideo accepting KVs as contents of input PCollection. Keys are the
* GCS URIs, values - VideoContext objects.
*/
@Experimental
public static class AnnotateVideoURIWithContext extends AnnotateVideo<KV<String, VideoContext>> {

public AnnotateVideoURIWithContext(List<Feature> featureList) {
Expand All @@ -163,6 +168,7 @@ public void processElement(ProcessContext context)
* Implementation of AnnotateVideo accepting KVs as contents of input PCollection. Keys are the
* ByteString encoded video contents, values - VideoContext objects.
*/
@Experimental
public static class AnnotateVideoBytesWithContext
extends AnnotateVideo<KV<ByteString, VideoContext>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
* limitations under the License.
*/
/** Provides DoFns for integration with Google Cloud AI Video Intelligence service. */
@Experimental
package org.apache.beam.sdk.extensions.ml;

import org.apache.beam.sdk.annotations.Experimental;

0 comments on commit d2089bc

Please sign in to comment.