Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def load_data(video_id):
|
|
| 34 |
return summary, transcription, unified_metadata, face_metadata
|
| 35 |
|
| 36 |
video_id = "IMFUOexuEXw"
|
| 37 |
-
video_path =
|
| 38 |
summary, transcription, unified_metadata, face_metadata = load_data(video_id)
|
| 39 |
|
| 40 |
# Load FAISS indexes
|
|
@@ -79,27 +79,27 @@ def create_video_clip(video_path, start_time, end_time, output_path):
|
|
| 79 |
# Streamlit UI
|
| 80 |
st.title("Video Analysis Dashboard")
|
| 81 |
|
| 82 |
-
# Sidebar with scrollable transcript
|
|
|
|
|
|
|
|
|
|
| 83 |
st.sidebar.header("Video Transcript")
|
| 84 |
transcript_text = transcription['transcription']
|
| 85 |
st.sidebar.text_area("Full Transcript", transcript_text, height=300)
|
| 86 |
|
| 87 |
# Main content
|
| 88 |
-
|
|
|
|
| 89 |
|
| 90 |
with col1:
|
| 91 |
-
st.header("Video Player")
|
| 92 |
-
st.video(video_path)
|
| 93 |
-
|
| 94 |
-
with col2:
|
| 95 |
-
st.header("Video Summary")
|
| 96 |
st.subheader("Prominent Faces")
|
| 97 |
for face in summary['prominent_faces']:
|
| 98 |
st.write(f"Face ID: {face['id']}, Appearances: {face['appearances']}")
|
| 99 |
if 'thumbnail' in face:
|
| 100 |
image = Image.open(io.BytesIO(base64.b64decode(face['thumbnail'])))
|
| 101 |
st.image(image, caption=f"Face ID: {face['id']}", width=100)
|
| 102 |
-
|
|
|
|
| 103 |
st.subheader("Themes")
|
| 104 |
for theme in summary['themes']:
|
| 105 |
st.write(f"Theme ID: {theme['id']}, Keywords: {', '.join(theme['keywords'])}")
|
|
|
|
| 34 |
return summary, transcription, unified_metadata, face_metadata
|
| 35 |
|
| 36 |
video_id = "IMFUOexuEXw"
|
| 37 |
+
video_path = "avengers_interview.mp4"
|
| 38 |
summary, transcription, unified_metadata, face_metadata = load_data(video_id)
|
| 39 |
|
| 40 |
# Load FAISS indexes
|
|
|
|
| 79 |
# Streamlit UI
|
| 80 |
st.title("Video Analysis Dashboard")
|
| 81 |
|
| 82 |
+
# Sidebar with full video and scrollable transcript
|
| 83 |
+
st.sidebar.header("Full Video")
|
| 84 |
+
st.sidebar.video(video_path)
|
| 85 |
+
|
| 86 |
st.sidebar.header("Video Transcript")
|
| 87 |
transcript_text = transcription['transcription']
|
| 88 |
st.sidebar.text_area("Full Transcript", transcript_text, height=300)
|
| 89 |
|
| 90 |
# Main content
|
| 91 |
+
st.header("Video Summary")
|
| 92 |
+
col1, col2 = st.columns(2)
|
| 93 |
|
| 94 |
with col1:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
st.subheader("Prominent Faces")
|
| 96 |
for face in summary['prominent_faces']:
|
| 97 |
st.write(f"Face ID: {face['id']}, Appearances: {face['appearances']}")
|
| 98 |
if 'thumbnail' in face:
|
| 99 |
image = Image.open(io.BytesIO(base64.b64decode(face['thumbnail'])))
|
| 100 |
st.image(image, caption=f"Face ID: {face['id']}", width=100)
|
| 101 |
+
|
| 102 |
+
with col2:
|
| 103 |
st.subheader("Themes")
|
| 104 |
for theme in summary['themes']:
|
| 105 |
st.write(f"Theme ID: {theme['id']}, Keywords: {', '.join(theme['keywords'])}")
|