masadonline commited on
Commit
cc78e03
·
verified ·
1 Parent(s): cda65e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -13
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
- for word in words:
58
- word_img_path = find_image_path(word)
59
- if word_img_path:
60
- st.image(word_img_path, caption=word, width=120)
61
- else:
62
- for char in word:
63
- if char.isalpha():
64
- char_img_path = find_image_path(char.lower())
65
- if char_img_path:
66
- st.image(char_img_path, caption=char.upper(), width=80)
67
- else:
68
- st.warning(f"Missing image for: {char.upper()}")
 
 
 
 
 
 
 
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)