Spaces:
Sleeping
Sleeping
RatanPrakash
commited on
Commit
·
a86c49e
1
Parent(s):
848a51f
Fix indentation in OCR text concatenation for consistent output formatting
Browse files
app.py
CHANGED
@@ -290,7 +290,7 @@ elif app_mode == "Task 1":
|
|
290 |
for line in result:
|
291 |
for box in line:
|
292 |
currText, confidence = box[1][0], box[1][1]
|
293 |
-
|
294 |
message = f"image ocr: {text} Caption: {caption}"
|
295 |
st.write(message)
|
296 |
#OCR result text to be parsed here through LLM and get product listing content.
|
@@ -327,8 +327,6 @@ elif app_mode == "Task 1":
|
|
327 |
for uploaded_image in uploaded_files:
|
328 |
# Load the uploaded image
|
329 |
image = Image.open(uploaded_image)
|
330 |
-
# st.image(image, caption=f'Uploaded Image: {uploaded_image.name}', use_column_width=True)
|
331 |
-
|
332 |
# Convert image to numpy array for OCR processing
|
333 |
img_array = np.array(image)
|
334 |
|
@@ -340,7 +338,7 @@ elif app_mode == "Task 1":
|
|
340 |
for line in result:
|
341 |
for box in line:
|
342 |
currText, confidence = box[1][0], box[1][1]
|
343 |
-
|
344 |
st.write(f"OCR Result: {text}")
|
345 |
#OCR result text to be parsed here through LLM and get product listing content.
|
346 |
simulate_progress()
|
|
|
290 |
for line in result:
|
291 |
for box in line:
|
292 |
currText, confidence = box[1][0], box[1][1]
|
293 |
+
text += currText + " "
|
294 |
message = f"image ocr: {text} Caption: {caption}"
|
295 |
st.write(message)
|
296 |
#OCR result text to be parsed here through LLM and get product listing content.
|
|
|
327 |
for uploaded_image in uploaded_files:
|
328 |
# Load the uploaded image
|
329 |
image = Image.open(uploaded_image)
|
|
|
|
|
330 |
# Convert image to numpy array for OCR processing
|
331 |
img_array = np.array(image)
|
332 |
|
|
|
338 |
for line in result:
|
339 |
for box in line:
|
340 |
currText, confidence = box[1][0], box[1][1]
|
341 |
+
text += currText + " "
|
342 |
st.write(f"OCR Result: {text}")
|
343 |
#OCR result text to be parsed here through LLM and get product listing content.
|
344 |
simulate_progress()
|