ratneshpasi03 commited on
Commit
434a67c
ยท
verified ยท
1 Parent(s): 6b68dea

Update pages/3_Skin_Tone_Bias.py

Browse files
Files changed (1) hide show
  1. pages/3_Skin_Tone_Bias.py +6 -6
pages/3_Skin_Tone_Bias.py CHANGED
@@ -135,7 +135,7 @@ elif input_method == "Default Images":
135
  if os.path.exists(default_path):
136
  default_images = sorted([f for f in os.listdir(default_path) if f.lower().endswith((".jpg", ".jpeg", ".png"))])
137
  if default_images:
138
- st.markdown("### ๐Ÿ–ผ๏ธ Default Images")
139
  cols = st.columns(3)
140
  selected_image_name = st.session_state.get('selected_default_image', None)
141
 
@@ -161,9 +161,9 @@ if image is not None:
161
  st.image(image, caption="Input Image", use_container_width=True)
162
 
163
  # Detection
164
- if st.button("๐Ÿ” Detect Faces"):
165
  if image is None:
166
- st.warning("โš ๏ธ Please provide an image before detection.")
167
  else:
168
  with st.spinner(f"Detecting faces using {model_choice}..."):
169
  if model_choice == "OpenCV":
@@ -174,12 +174,12 @@ if st.button("๐Ÿ” Detect Faces"):
174
  draw_image, result = detect_faces_dlib(image)
175
 
176
  if result:
177
- st.success(f"โœ… Detected {len(result)} face(s) with {model_choice}")
178
  st.image(draw_image, caption=f"{model_choice} Detection Output", use_container_width=True)
179
 
180
  face_images = get_face_crops(image, result)
181
 
182
- st.markdown("### ๐Ÿ‘ค Cropped Face Previews")
183
  num_faces = len(face_images)
184
  cols_per_row = 3
185
 
@@ -197,4 +197,4 @@ if st.button("๐Ÿ” Detect Faces"):
197
  unsafe_allow_html=True
198
  )
199
  else:
200
- st.warning(f"โš ๏ธ No faces detected by {model_choice}. Try a different model or image.")
 
135
  if os.path.exists(default_path):
136
  default_images = sorted([f for f in os.listdir(default_path) if f.lower().endswith((".jpg", ".jpeg", ".png"))])
137
  if default_images:
138
+ st.markdown("### Default Images")
139
  cols = st.columns(3)
140
  selected_image_name = st.session_state.get('selected_default_image', None)
141
 
 
161
  st.image(image, caption="Input Image", use_container_width=True)
162
 
163
  # Detection
164
+ if st.button("Detect Faces"):
165
  if image is None:
166
+ st.warning("Please provide an image before detection.")
167
  else:
168
  with st.spinner(f"Detecting faces using {model_choice}..."):
169
  if model_choice == "OpenCV":
 
174
  draw_image, result = detect_faces_dlib(image)
175
 
176
  if result:
177
+ st.success(f"Detected {len(result)} face(s) with {model_choice}")
178
  st.image(draw_image, caption=f"{model_choice} Detection Output", use_container_width=True)
179
 
180
  face_images = get_face_crops(image, result)
181
 
182
+ st.markdown("### Cropped Face Previews")
183
  num_faces = len(face_images)
184
  cols_per_row = 3
185
 
 
197
  unsafe_allow_html=True
198
  )
199
  else:
200
+ st.warning(f"No faces detected by {model_choice}. Try a different model or image.")