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_upload(" Upload a video ", type=["mp4"]) example = open("test_video.mp4") st.video(example, width=250) if st.button("example"): file_video = "test_video.mp4" ## if file_video is not None: video = open(file_video) video_bytes = video.read() output = smartcities(video_bytes) col1, col2 = st.columns(2) if output is not None: with col1: st.subheader("Input: ") st.video(video_bytes) with col2: st.subheader("Output: ") st.video(output)