File size: 868 Bytes
b412cbb
 
 
 
 
 
 
 
403cc3b
499fef2
b412cbb
 
 
499fef2
b412cbb
8c7d1d3
65800c4
179ba1e
 
b412cbb
 
 
 
 
179ba1e
 
 
 
 
 
b412cbb
 
 
 
 
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
import streamlit as st
from prediction import smartcities

# Streamlit Interface
st.header("Smart City Cars and Bikes detection")
st.markdown("Upload a video or select the example")

## Select video to inference
file_video = st.file_uploader(" Upload a video ", type=["mp4"])
# st.video(example)
if st.button("example"):
    file_video = "test_video.mp4"

## Process video
if file_video is not None:
    video = open(file_video, "wb")
    # output = smartcities(video)
    video_bytes = video.read()
    output = smartcities(file_video)
    col1, col2 = st.columns(2)
    
    if output is not None:
        with col1:
            st.subheader("Input: ")
            # st.video(video)
            st.video(video_bytes)
        with col2:
            st.subheader("Output: ")
            st.video(output)
            st.download_button("Download", output)