|
import streamlit as st |
|
from prediction import smartcities |
|
|
|
|
|
st.header("Smart City Cars and Bikes detection") |
|
st.markdown("Upload a video or select the example") |
|
|
|
|
|
file_video = st.file_uploader(" Upload a video ", type=["mp4"]) |
|
if st.button("example"): |
|
file_video = "test_video.mp4" |
|
|
|
|
|
if file_video is not None: |
|
sc = smartcities() |
|
output = sc.predict(file_video) |
|
col1, col2 = st.columns(2) |
|
|
|
if output is not None: |
|
with col1: |
|
st.subheader("Input: ") |
|
|
|
|
|
|
|
|
|
with col2: |
|
st.subheader("Output: ") |
|
output_video = open(output, "rb") |
|
output_bytes = output_video.read() |
|
st.video(output_bytes) |
|
st.download_button("Download", output_bytes, mime="video/mp4") |
|
|
|
|
|
|
|
|
|
|
|
|