Spaces:
Sleeping
Sleeping
testing changes
Browse files
app.py
CHANGED
@@ -58,14 +58,14 @@ def main():
|
|
58 |
cropped_image = cv2.resize(cropped_image, (640, 640))
|
59 |
cv2.imwrite('card_number_image.jpg', cropped_image)
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
|
67 |
-
|
68 |
-
display_text = 'No number so far'
|
69 |
st.image('card_number_image.jpg', caption=f"{display_text}", use_column_width=True)
|
70 |
|
71 |
image = Image.open('card_image.jpg')
|
@@ -77,7 +77,7 @@ def main():
|
|
77 |
draw.text((x1, y1), text, fill="red")
|
78 |
# Saving Images
|
79 |
image_resized.save('card_highlighted_image.jpg')
|
80 |
-
display_text = 'Here is the card on the image.'
|
81 |
st.image('card_highlighted_image.jpg', caption=f"{display_text}", use_column_width=True)
|
82 |
|
83 |
st.session_state.pop("card")
|
|
|
58 |
cropped_image = cv2.resize(cropped_image, (640, 640))
|
59 |
cv2.imwrite('card_number_image.jpg', cropped_image)
|
60 |
|
61 |
+
extracted_digit = get_digit(
|
62 |
+
model_path="card_number_extractor.tflite",
|
63 |
+
image_path='card_number_image.jpg',
|
64 |
+
threshold=0.4
|
65 |
+
)
|
66 |
|
67 |
+
display_text = f'Here is the zoomed card number: {extracted_digit}'
|
68 |
+
# display_text = 'No number so far'
|
69 |
st.image('card_number_image.jpg', caption=f"{display_text}", use_column_width=True)
|
70 |
|
71 |
image = Image.open('card_image.jpg')
|
|
|
77 |
draw.text((x1, y1), text, fill="red")
|
78 |
# Saving Images
|
79 |
image_resized.save('card_highlighted_image.jpg')
|
80 |
+
display_text = 'Here is the card number on the image.'
|
81 |
st.image('card_highlighted_image.jpg', caption=f"{display_text}", use_column_width=True)
|
82 |
|
83 |
st.session_state.pop("card")
|