juanpablomesa commited on
Commit
8ed3901
·
1 Parent(s): 32565de

Added a variable to handle OCR extraction frame rate

Browse files
Files changed (1) hide show
  1. handler.py +3 -1
handler.py CHANGED
@@ -19,6 +19,8 @@ import json
19
 
20
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
21
 
 
 
22
 
23
  class EndpointHandler:
24
  def __init__(self, path=""):
@@ -198,7 +200,7 @@ class EndpointHandler:
198
  # frame_texts = [self.reader.readtext(frame, detail=0) for frame in frames]
199
  frame_texts = [
200
  self.reader.readtext(frames[i], detail=0)
201
- for i in range(0, len(frames), 6)
202
  ]
203
  texts_set = set()
204
  for text_list in frame_texts:
 
19
 
20
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
21
 
22
+ EXTRACT_EVERY_X_FRAMES = 6
23
+
24
 
25
  class EndpointHandler:
26
  def __init__(self, path=""):
 
200
  # frame_texts = [self.reader.readtext(frame, detail=0) for frame in frames]
201
  frame_texts = [
202
  self.reader.readtext(frames[i], detail=0)
203
+ for i in range(0, len(frames), EXTRACT_EVERY_X_FRAMES)
204
  ]
205
  texts_set = set()
206
  for text_list in frame_texts: