Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -52,20 +52,26 @@ def find_image_path(name):
|
|
52 |
return None
|
53 |
|
54 |
def display_sign_language(english_text):
|
55 |
-
words = english_text.lower().split()
|
56 |
st.markdown("### 👐 Sign Language Representation")
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
if
|
64 |
-
char_img_path =
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
# --- Streamlit UI ---
|
71 |
urdu_text = st.text_area("📝 Enter Urdu Text", height=150)
|
|
|
52 |
return None
|
53 |
|
54 |
def display_sign_language(english_text):
|
|
|
55 |
st.markdown("### 👐 Sign Language Representation")
|
56 |
+
|
57 |
+
for word in english_text.split():
|
58 |
+
st.markdown(f"**{word}**")
|
59 |
+
for idx, char in enumerate(word):
|
60 |
+
if char.isalpha():
|
61 |
+
char_img_path = find_image_path(char.lower())
|
62 |
+
if char_img_path:
|
63 |
+
st.image(char_img_path, caption=char.upper(), width=80)
|
64 |
+
else:
|
65 |
+
st.warning(f"Missing image for: {char.upper()}")
|
66 |
+
elif char == " ":
|
67 |
+
space_img = find_image_path("space")
|
68 |
+
if space_img:
|
69 |
+
st.image(space_img, caption="SPACE", width=40)
|
70 |
+
|
71 |
+
# Add space image between words
|
72 |
+
space_img = find_image_path("space")
|
73 |
+
if space_img:
|
74 |
+
st.image(space_img, caption="SPACE", width=40)
|
75 |
|
76 |
# --- Streamlit UI ---
|
77 |
urdu_text = st.text_area("📝 Enter Urdu Text", height=150)
|