Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ import base64
|
|
| 12 |
|
| 13 |
# Page config first
|
| 14 |
st.set_page_config(
|
| 15 |
-
page_title="
|
| 16 |
page_icon="🔥",
|
| 17 |
layout="wide",
|
| 18 |
initial_sidebar_state="expanded"
|
|
@@ -30,7 +30,7 @@ for key in ["processed_frames", "slider_value", "processed_video", "start_time"]
|
|
| 30 |
with st.sidebar:
|
| 31 |
st.header("Upload & Settings")
|
| 32 |
source_file = st.file_uploader("Upload image/video", type=["jpg", "jpeg", "png", "bmp", "webp", "mp4"])
|
| 33 |
-
confidence = float(st.slider("Confidence Threshold",
|
| 34 |
fps_options = {
|
| 35 |
"Original FPS": None,
|
| 36 |
"3 FPS": 3,
|
|
@@ -41,13 +41,13 @@ with st.sidebar:
|
|
| 41 |
"1 frame/30s": 0.0333
|
| 42 |
}
|
| 43 |
video_option = st.selectbox("Output Frame Rate", list(fps_options.keys()))
|
| 44 |
-
process_button = st.button("Detect
|
| 45 |
progress_bar = st.progress(0)
|
| 46 |
progress_text = st.empty()
|
| 47 |
download_slot = st.empty()
|
| 48 |
|
| 49 |
# Main page
|
| 50 |
-
st.title("
|
| 51 |
col1, col2 = st.columns(2)
|
| 52 |
with col1:
|
| 53 |
st.image("https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_1.jpeg", use_column_width=True)
|
|
@@ -109,6 +109,10 @@ def create_synced_video_pair(orig_url, proc_url, pair_id):
|
|
| 109 |
"""
|
| 110 |
return html
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
# Example videos with synchronization
|
| 113 |
st.header("Example Results")
|
| 114 |
examples = [
|
|
@@ -123,9 +127,7 @@ for title, orig_file, proc_file in examples:
|
|
| 123 |
video_html = create_synced_video_pair(orig_url, proc_url, pair_id)
|
| 124 |
st.markdown(video_html, unsafe_allow_html=True)
|
| 125 |
|
| 126 |
-
|
| 127 |
-
result_cols = st.columns(2)
|
| 128 |
-
viewer_slot = st.empty()
|
| 129 |
|
| 130 |
# Load model
|
| 131 |
try:
|
|
|
|
| 12 |
|
| 13 |
# Page config first
|
| 14 |
st.set_page_config(
|
| 15 |
+
page_title="Fire Watch: Fire and Smoke Detection with an AI Vision Model",
|
| 16 |
page_icon="🔥",
|
| 17 |
layout="wide",
|
| 18 |
initial_sidebar_state="expanded"
|
|
|
|
| 30 |
with st.sidebar:
|
| 31 |
st.header("Upload & Settings")
|
| 32 |
source_file = st.file_uploader("Upload image/video", type=["jpg", "jpeg", "png", "bmp", "webp", "mp4"])
|
| 33 |
+
confidence = float(st.slider("Confidence Threshold", 10, 100, 20)) / 100
|
| 34 |
fps_options = {
|
| 35 |
"Original FPS": None,
|
| 36 |
"3 FPS": 3,
|
|
|
|
| 41 |
"1 frame/30s": 0.0333
|
| 42 |
}
|
| 43 |
video_option = st.selectbox("Output Frame Rate", list(fps_options.keys()))
|
| 44 |
+
process_button = st.button("Detect fire")
|
| 45 |
progress_bar = st.progress(0)
|
| 46 |
progress_text = st.empty()
|
| 47 |
download_slot = st.empty()
|
| 48 |
|
| 49 |
# Main page
|
| 50 |
+
st.title("Fire Watch: AI-Powered Fire and Smoke Detection")
|
| 51 |
col1, col2 = st.columns(2)
|
| 52 |
with col1:
|
| 53 |
st.image("https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_1.jpeg", use_column_width=True)
|
|
|
|
| 109 |
"""
|
| 110 |
return html
|
| 111 |
|
| 112 |
+
st.header("Your Results")
|
| 113 |
+
result_cols = st.columns(2)
|
| 114 |
+
viewer_slot = st.empty()
|
| 115 |
+
|
| 116 |
# Example videos with synchronization
|
| 117 |
st.header("Example Results")
|
| 118 |
examples = [
|
|
|
|
| 127 |
video_html = create_synced_video_pair(orig_url, proc_url, pair_id)
|
| 128 |
st.markdown(video_html, unsafe_allow_html=True)
|
| 129 |
|
| 130 |
+
|
|
|
|
|
|
|
| 131 |
|
| 132 |
# Load model
|
| 133 |
try:
|