masadonline commited on
Commit
4acb7e3
·
verified ·
1 Parent(s): 49b5ce0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -9,7 +9,7 @@ st.set_page_config(page_title="DeafTranslator", layout="centered")
9
  st.title("🤟 DeafTranslator")
10
  st.markdown("Translate **Urdu** text to **English** and view it in **Sign Language** (ASL).")
11
 
12
- SIGN_IMAGE_FOLDER = "sign_images" # Place images like a.jpg, b.jpg, hello.jpg, etc. here
13
 
14
  @st.cache_resource
15
  def load_argos_urdu_to_english():
@@ -53,9 +53,11 @@ def display_sign_language(english_text):
53
  else:
54
  for char in word:
55
  if char.isalpha():
56
- char_img_path = os.path.join(SIGN_IMAGE_FOLDER, f"{char.upper()}.jpg")
57
  if os.path.exists(char_img_path):
58
  st.image(char_img_path, caption=char.upper(), width=80)
 
 
59
 
60
  # --- Streamlit UI ---
61
  urdu_text = st.text_area("📝 Enter Urdu Text", height=150)
 
9
  st.title("🤟 DeafTranslator")
10
  st.markdown("Translate **Urdu** text to **English** and view it in **Sign Language** (ASL).")
11
 
12
+ SIGN_IMAGE_FOLDER = "sign_images" # Make sure this folder contains a.jpg, b.jpg, etc.
13
 
14
  @st.cache_resource
15
  def load_argos_urdu_to_english():
 
53
  else:
54
  for char in word:
55
  if char.isalpha():
56
+ char_img_path = os.path.join(SIGN_IMAGE_FOLDER, f"{char.lower()}.jpg")
57
  if os.path.exists(char_img_path):
58
  st.image(char_img_path, caption=char.upper(), width=80)
59
+ else:
60
+ st.warning(f"Missing image for: {char.upper()}")
61
 
62
  # --- Streamlit UI ---
63
  urdu_text = st.text_area("📝 Enter Urdu Text", height=150)