GoodML commited on
Commit
0b74a08
·
verified ·
1 Parent(s): 82d8948

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -154,10 +154,11 @@ def get_information_from_video_using_OCR(video_path, interval=2):
154
  text = pytesseract.image_to_string(preprocessed_frame, lang='eng', config='--psm 6 --oem 3')
155
  cleaned_text = clean_ocr_text(text)
156
 
157
- if cleaned_text: # Only save non-empty results
158
- with open(output_file, 'a', encoding='utf-8') as f:
159
- f.write(cleaned_text + "\n\n")
160
- print(f"Extracted text at {timestamp:.2f} seconds")
 
161
 
162
  frame_count += 1
163
 
 
154
  text = pytesseract.image_to_string(preprocessed_frame, lang='eng', config='--psm 6 --oem 3')
155
  cleaned_text = clean_ocr_text(text)
156
 
157
+ if cleaned_text:
158
+ extracted_text += cleaned_text + "\n\n"
159
+ # print(f"Text found at frame {frame_count}: {cleaned_text[:50]}...")
160
+
161
+
162
 
163
  frame_count += 1
164