sonobit commited on
Commit
05d3c39
·
1 Parent(s): 6ccdbee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -16
app.py CHANGED
@@ -1,18 +1,13 @@
1
  import streamlit as st
2
- import numpy as np
3
- from io import BytesIO
4
- from PIL import Image
5
- from terran.io import open_image
6
- from terran.vis import display_image, vis_faces
7
- from terran.face import face_detection
8
 
9
- file= st.file_uploader('Choose an image',type=['png','jpg'])
10
- if file is not None:
11
- st.write(file.name)
12
- image = Image.open(BytesIO(file.read()))
13
- image = np.asarray(image.convert('RGB'))
14
- if len(image.shape) == 2:
15
- image = np.stack([image] * 3, axis=-1)
16
- #image = open_image(file.name)
17
- detections = face_detection(image)
18
- display_image(vis_faces(image, detections))
 
1
  import streamlit as st
2
+ from streamlit_terran_timeline import generate_timeline, terran_timeline
 
 
 
 
 
3
 
4
+ # Generate the timeline information
5
+ timeline = generate_timeline("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
6
+
7
+ #
8
+ # Display the timeline. If the users click, you'll get the exact second of
9
+ # the part of the timeline video. By default, it returns 0.
10
+ #
11
+ start_time = terran_timeline(timeline)
12
+
13
+ st.write(f"User clicked on second {start_time}")