File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
tika-parsers/src/main/resources/org/apache/tika/parser/recognition/tf Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 38
38
import sys
39
39
import tarfile
40
40
41
+ try :
42
+ #This import is placed inside here to ensure that video_util and OpenCV is not required for image recognition APIs
43
+ from video_util import get_center_frame , get_frames_interval , get_n_frames
44
+ except :
45
+ print ("Can't import video libraries, No video functionality is available" )
46
+
41
47
import numpy as np
42
48
from six .moves import urllib
43
49
import tensorflow as tf
@@ -404,7 +410,7 @@ def classify_image():
404
410
405
411
ALLOWED_MODE = set ([CENTER ,INTERVAL , FIXED ])
406
412
407
- @app .route ("/inception/v3 /classify/video" , methods = ["GET" , "POST" ])
413
+ @app .route ("/inception/v4 /classify/video" , methods = ["GET" , "POST" ])
408
414
def classify_video ():
409
415
"""
410
416
API to classify videos
@@ -421,9 +427,6 @@ def classify_video():
421
427
422
428
ext - If video is sent in binary format, then ext is needed to tell OpenCV which decoder to use. eg ".mp4"
423
429
"""
424
- #This import is placed here to ensure that video_util and OpenCV is not required for image recognition APIs
425
- #It will be imported only once during first API call and so first call could be slow
426
- from video_util import get_center_frame , get_frames_interval , get_n_frames
427
430
428
431
st = current_time ()
429
432
topk = int (request .args .get ("topk" , "10" ))
You can’t perform that action at this time.
0 commit comments