Commit
·
4dee1d9
1
Parent(s):
5f26241
Make switching between modalities a bit smoother
Browse files
search.py
CHANGED
@@ -53,24 +53,25 @@ def write_grascii_search():
|
|
53 |
max_chars=MAX_GRASCII_LENGTH,
|
54 |
)
|
55 |
else:
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
74 |
|
75 |
if image_data:
|
76 |
image = Image.open(image_data).convert("RGBA")
|
|
|
53 |
max_chars=MAX_GRASCII_LENGTH,
|
54 |
)
|
55 |
else:
|
56 |
+
with placeholder.container():
|
57 |
+
image_data = st.file_uploader(
|
58 |
+
"Image",
|
59 |
+
type=["png", "jpg"],
|
60 |
+
help="""
|
61 |
+
Upload an image of a shorthand form.
|
62 |
+
|
63 |
+
At this time, minimal preprocessing is performed on images
|
64 |
+
before running them through the model. For best results,
|
65 |
+
upload an image:
|
66 |
+
|
67 |
+
- of a closely cropped, single shorthand form
|
68 |
+
- with the shorthand written in black on a white background
|
69 |
+
- that does not contain marks beside the shorthand form
|
70 |
+
""",
|
71 |
+
)
|
72 |
+
save = st.checkbox(
|
73 |
+
"Save images I upload for potential inclusion in open-source datasets used to train and improve models"
|
74 |
+
)
|
75 |
|
76 |
if image_data:
|
77 |
image = Image.open(image_data).convert("RGBA")
|