[ 
https://issues.apache.org/jira/browse/TIKA-2322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15968622#comment-15968622
 ] 

ASF GitHub Bot commented on TIKA-2322:
--------------------------------------

smadha commented on a change in pull request #168: fix for TIKA-2322 
contributed by msha...@usc.edu
URL: https://github.com/apache/tika/pull/168#discussion_r111530110
 
 

 ##########
 File path: 
tika-parsers/src/test/java/org/apache/tika/parser/recognition/tf/TensorflowVideoRecParserTest.java
 ##########
 @@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tika.parser.recognition.tf;
+
+import org.apache.tika.config.Param;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.recognition.RecognisedObject;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+
+@Ignore
+public class TensorflowVideoRecParserTest {
+
+    @Test
+    public void recognise() throws Exception {
+        TensorflowRESTVideoRecogniser recogniser = new 
TensorflowRESTVideoRecogniser();
+        recogniser.initialize(new HashMap<String, Param>());
+        try (InputStream stream = 
getClass().getClassLoader().getResourceAsStream("test-documents/testVideoMp4.mp4"))
 {
+            List<RecognisedObject> objects = recogniser.recognise(stream, new 
DefaultHandler(), new Metadata(), new ParseContext());
+            
+            Assert.assertTrue(objects.size() > 0);
+            Set<String> objectLabels = new HashSet<>();
+            for (RecognisedObject object : objects) {
+                objectLabels.add(object.getLabel());
+                System.out.println(object.getLabel());
 
 Review comment:
   Good catch again. This should be removed
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Video labeling using existing ObjectRecognition
> -----------------------------------------------
>
>                 Key: TIKA-2322
>                 URL: https://issues.apache.org/jira/browse/TIKA-2322
>             Project: Tika
>          Issue Type: Improvement
>          Components: parser
>            Reporter: Madhav Sharan
>            Assignee: Chris A. Mattmann
>              Labels: memex
>             Fix For: 1.15
>
>
> Currently TIKA supports ObjectRecognition in Images. I am proposing to extend 
> this to support videos. 
> Idea is -
> 1. Extract frames from video and run IncV3 to get labels for these frames. 
> 2. We average confidence scores of same labels for each frame. 
> 3. Return results in sorted order of confidence score. 
> I am writing code for different modes of frame extractions -
> 1. Extract center image.
> 2. Extract frames after every fixed interval.
> 3. Extract N frames equally divided across video.
> We used this approach in [0]. Code in [1]
> [0] https://github.com/USCDataScience/hadoop-pot
> [1] https://github.com/USCDataScience/video-recognition



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to