madhavkotecha commited on
Commit
443264e
·
verified ·
1 Parent(s): 11d603e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -24,7 +24,6 @@ roberta_model = AutoModelForMaskedLM.from_pretrained("roberta-large").to(device)
24
  print(f'TrOCR and YOLO Models loaded on {device}')
25
 
26
 
27
- -------------------------------------------------------
28
 
29
 
30
  CONFIDENCE_THRESHOLD = 0.72
@@ -145,7 +144,6 @@ def inference(image_path, debug=False, return_texts='final'):
145
  # image_path = "raw_dataset/g06-037h.png"
146
  df, bounding_path, tokens, logits, gen_texts = inference(image_path, debug=False, return_texts='final_v2')
147
 
148
- ----------------------------------------------------------------
149
 
150
 
151
  def get_new_logits(tokens):
@@ -174,7 +172,6 @@ for i, j in zip(indices[0], indices[1]):
174
  new_logits = get_new_logits(tokens)
175
 
176
 
177
- ----------------------------------------------------------------
178
 
179
 
180
  for i, j in zip(indices[0], indices[1]):
@@ -184,7 +181,7 @@ logits_flattened = slogits.reshape(-1, slogits.shape[-1])
184
  processor.batch_decode([logits_flattened.argmax(-1)], skip_special_tokens=True)
185
 
186
 
187
- ---------------------------------------
188
 
189
 
190
  def gradio_inference(image_path):
 
24
  print(f'TrOCR and YOLO Models loaded on {device}')
25
 
26
 
 
27
 
28
 
29
  CONFIDENCE_THRESHOLD = 0.72
 
144
  # image_path = "raw_dataset/g06-037h.png"
145
  df, bounding_path, tokens, logits, gen_texts = inference(image_path, debug=False, return_texts='final_v2')
146
 
 
147
 
148
 
149
  def get_new_logits(tokens):
 
172
  new_logits = get_new_logits(tokens)
173
 
174
 
 
175
 
176
 
177
  for i, j in zip(indices[0], indices[1]):
 
181
  processor.batch_decode([logits_flattened.argmax(-1)], skip_special_tokens=True)
182
 
183
 
184
+
185
 
186
 
187
  def gradio_inference(image_path):