RP-Azul commited on
Commit
b24c849
Β·
verified Β·
1 Parent(s): d83f26d

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -2
src/streamlit_app.py CHANGED
@@ -31,13 +31,18 @@ def process_image(image_path, gpu=False):
31
  return img, saved_text
32
 
33
  if uploaded_file:
 
 
34
  # Save the uploaded file temporarily
35
  with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as temp_file:
36
  temp_file.write(uploaded_file.read())
37
  temp_path = temp_file.name
38
 
39
- # Process image
40
- img_result, extracted_text = process_image(temp_path)
 
 
 
41
 
42
  # Show image with bounding boxes
43
  st.image(cv2.cvtColor(img_result, cv2.COLOR_BGR2RGB), caption="Detected Text", use_column_width=True)
 
31
  return img, saved_text
32
 
33
  if uploaded_file:
34
+ st.success("βœ… Image uploaded successfully!")
35
+
36
  # Save the uploaded file temporarily
37
  with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as temp_file:
38
  temp_file.write(uploaded_file.read())
39
  temp_path = temp_file.name
40
 
41
+ with st.spinner("πŸ” Running OCR..."):
42
+ # Process image
43
+ img_result, extracted_text = process_image(temp_path)
44
+
45
+ st.success("πŸŽ‰ OCR complete!")
46
 
47
  # Show image with bounding boxes
48
  st.image(cv2.cvtColor(img_result, cv2.COLOR_BGR2RGB), caption="Detected Text", use_column_width=True)