tstone87 commited on
Commit
43d04b9
·
verified ·
1 Parent(s): fb52d4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -39
app.py CHANGED
@@ -49,53 +49,18 @@ with st.sidebar:
49
  # Main page
50
  st.title("Fire Watch: AI-Powered Fire and Smoke Detection")
51
 
52
- # Custom HTML for images with hover effect using CSS
53
  col1, col2 = st.columns(2)
54
  with col1:
55
- fire_4_url = "https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_4.jpeg"
56
  fire_4a_url = "https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_4a.jpg"
57
- fire_4_bytes = requests.get(fire_4_url).content
58
- fire_4a_bytes = requests.get(fire_4a_url).content
59
- fire_4_b64 = base64.b64encode(fire_4_bytes).decode('utf-8')
60
- fire_4a_b64 = base64.b64encode(fire_4a_bytes).decode('utf-8')
61
- html1 = f"""
62
- <div style="position: relative; width: 100%;">
63
- <img src="data:image/jpeg;base64,{fire_4_b64}" style="width: 100%; height: auto; display: block;">
64
- <img src="data:image/jpeg;base64,{fire_4a_b64}"
65
- style="position: absolute; top: 0; left: 0; width: 100%; height: auto; opacity: 0; transition: opacity 0.3s;">
66
- <style>
67
- div:hover > img:nth-child(2) {{
68
- opacity: 1;
69
- }}
70
- </style>
71
- </div>
72
- """
73
- st.markdown(html1, unsafe_allow_html=True)
74
 
75
  with col2:
76
- fire_3_url = "https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_3.png"
77
  fire_3a_url = "https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_3a.jpg"
78
- fire_3_bytes = requests.get(fire_3_url).content
79
- fire_3a_bytes = requests.get(fire_3a_url).content
80
- fire_3_b64 = base64.b64encode(fire_3_bytes).decode('utf-8')
81
- fire_3a_b64 = base64.b64encode(fire_3a_bytes).decode('utf-8')
82
- html2 = f"""
83
- <div style="position: relative; width: 100%;">
84
- <img src="data:image/png;base64,{fire_3_b64}" style="width: 100%; height: auto; display: block;">
85
- <img src="data:image/jpeg;base64,{fire_3a_b64}"
86
- style="position: absolute; top: 0; left: 0; width: 100%; height: auto; opacity: 0; transition: opacity 0.3s;">
87
- <style>
88
- div:hover > img:nth-child(2) {{
89
- opacity: 1;
90
- }}
91
- </style>
92
- </div>
93
- """
94
- st.markdown(html2, unsafe_allow_html=True)
95
 
96
  st.markdown("""
97
- Early wildfire detection using YOLOv8 AI vision model. Hover over the images above to see detection results!
98
- See video examples below or upload your own content!
99
  """)
100
 
101
  # Function to create synchronized video pair HTML
 
49
  # Main page
50
  st.title("Fire Watch: AI-Powered Fire and Smoke Detection")
51
 
52
+ # Display result images directly
53
  col1, col2 = st.columns(2)
54
  with col1:
 
55
  fire_4a_url = "https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_4a.jpg"
56
+ st.image(fire_4a_url, use_column_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  with col2:
 
59
  fire_3a_url = "https://huggingface.co/spaces/tstone87/ccr-colorado/resolve/main/Fire_3a.jpg"
60
+ st.image(fire_3a_url, use_column_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  st.markdown("""
63
+ Early wildfire detection using YOLOv8 AI vision model. See detected results above and video examples below, or upload your own content!
 
64
  """)
65
 
66
  # Function to create synchronized video pair HTML