SuriRaja commited on
Commit
81fd4f7
·
verified ·
1 Parent(s): 2276e4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -7,6 +7,9 @@ import tempfile
7
  import joblib
8
  from typing import Optional, Tuple, Dict, Any, List
9
 
 
 
 
10
  # (Optional) Face landmarks similar to earlier app
11
  try:
12
  import mediapipe as mp
@@ -484,10 +487,12 @@ if mode == "Image" and 'analyze_image' in locals() and analyze_image:
484
  html, frame_rgb_blurred = analyze_face(st.session_state.captured_image_bgr)
485
  if frame_rgb_blurred is not None:
486
  preview_placeholder.image(frame_rgb_blurred, caption="Blurred Image", use_container_width=True)
487
- report_placeholder.html(html, height=1200, scrolling=True)
 
488
 
489
  elif mode == "Video" and 'analyze_video_btn' in locals() and analyze_video_btn:
490
  html, frame_rgb_blurred = analyze_video(st.session_state.captured_video_path)
491
  if frame_rgb_blurred is not None:
492
  preview_placeholder.image(frame_rgb_blurred, caption="Blurred Key Frame", use_container_width=True)
493
- report_placeholder.html(html, height=1200, scrolling=True)
 
 
7
  import joblib
8
  from typing import Optional, Tuple, Dict, Any, List
9
 
10
+ # NEW: use components.html for the long HTML report
11
+ import streamlit.components.v1 as components
12
+
13
  # (Optional) Face landmarks similar to earlier app
14
  try:
15
  import mediapipe as mp
 
487
  html, frame_rgb_blurred = analyze_face(st.session_state.captured_image_bgr)
488
  if frame_rgb_blurred is not None:
489
  preview_placeholder.image(frame_rgb_blurred, caption="Blurred Image", use_container_width=True)
490
+ with report_placeholder:
491
+ components.html(html, height=1200, scrolling=True)
492
 
493
  elif mode == "Video" and 'analyze_video_btn' in locals() and analyze_video_btn:
494
  html, frame_rgb_blurred = analyze_video(st.session_state.captured_video_path)
495
  if frame_rgb_blurred is not None:
496
  preview_placeholder.image(frame_rgb_blurred, caption="Blurred Key Frame", use_container_width=True)
497
+ with report_placeholder:
498
+ components.html(html, height=1200, scrolling=True)