-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamlit_App.py
83 lines (63 loc) · 2.79 KB
/
streamlit_App.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import streamlit as st
from streamlit_option_menu import option_menu
import requests
from streamlit_lottie import st_lottie
st.set_page_config(page_title='photoapp', page_icon=":camera:",layout="wide")
with st.sidebar:
sltd = option_menu(
menu_title="Navigation",
options=["Main","Photo","Video"],
icons=["info-circle","camera2","film"],
menu_icon = "grid"
)
if sltd == "Main":
st.subheader("Welcome to photoapp :camera: ")
st.title("Webapp to upload Photos and Videos ")
def load_lottie(url):
r= requests.get(url)
if r.status_code != 200:
return None
return r.json()
lottie_coding = load_lottie("https://assets7.lottiefiles.com/packages/lf20_GxMZME.json")
st_lottie(lottie_coding,height=400)
st.write('''
This webapp is created by me, Pratyasha Panda of Department of Information Technology, First Year.
This webapp allows the user to either upload the desired Photo or Video from Local files or from Webcam directly.
This is the first time I've created an webapp using Streamlit so your feedbacks and critiques are highly welcomed.
Kindly select Photo or Video from the Navigation Menu to proceed with the webapp.
''')
if sltd == "Photo":
st.title("Upload Photo 🎞 ")
st.markdown("---")
sltd = option_menu(
menu_title="Choose the path to proceed ",
options=["Upload from Local Files","Capture using Webcam"],
icons=["file-earmark-image","webcam"],
menu_icon ="circle-square",
orientation="horizontal"
)
if sltd == "Upload from Local Files":
st.write("Upload Photo from Local Files :open_file_folder: ")
image=st.file_uploader("Select the Photo you want to upload ",type=["png","jpg","jpeg"])
cpton=st.text_input("Enter Caption for selected Photo :page_with_curl: ",)
if image is not None:
st.image(image,caption=cpton)
if sltd == "Capture using Webcam" :
st.write("Capture Photo using Webcam :technologist: ")
img=st.camera_input("Click Photo")
cpton=st.text_input("Enter Caption for Captured Photo :page_with_curl: ")
if img is not None:
st.image(img,caption=cpton)
if sltd == "Video":
st.title("Upload Video🎬 ")
st.markdown("---")
st.write("Upload Video from Files :open_file_folder: ")
video=st.file_uploader("Select the Video you want to upload ",type=["mkv","mp4","mpeg"])
cptn =st.text_input("Enter Caption for selected Video :page_with_curl:")
if video is not None:
st.video(video,caption=cptn)
# st.write("Record Video using Webcam : ")
# vid=st.camera_input("Record Video")
# cptn =st.text_input("Enter Caption for recorded Video")
# if vid is not None:
# st.video(vid,cptn)