-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
31 lines (25 loc) · 1.08 KB
/
app.py
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
import streamlit as st
from img_classification import teachable_machine_classification
from PIL import Image
app_mode = st.sidebar.selectbox('Select Page',['Home','Check for Cracks','Help']) #two pages
if app_mode=='Home':
st.title("BRIDGE CRACK DETECTION SYSTEM")
st.image('bridge_img.jpg')
#st.header("Checking for crack availability in bridge walls")
#st.text("Upload wall image")
elif app_mode == 'Check for Cracks':
uploaded_file = st.file_uploader("Upload image ...", type="jpg")
if uploaded_file is not None:
image = Image.open(uploaded_file)
st.image(image, caption='Uploaded photograph.', use_column_width=True)
st.write("")
st.write("Detecting...")
label = teachable_machine_classification(image, 'model_ps1.h5')
if label == 0:
st.success("No Crack Detected!:white_check_mark:")
else:
st.warning("Crack Detected!!:warning:")
elif app_mode == 'Help':
st.header("Help")
st.write("Please contact for any quries:")
st.write("email: prasaddevkar179@gmail.com")