Ci-Dave commited on
Commit
69f8699
·
1 Parent(s): afe9e31
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -49,9 +49,6 @@ def explain_ai(prompt):
49
  except Exception as e:
50
  return f"Error: {str(e)}"
51
 
52
- # Streamlit app with multiple pages
53
- st.set_page_config(page_title="Imaize: Smart Image Analyzer with XAI")
54
-
55
  # Sidebar navigation
56
  st.sidebar.title("Navigation")
57
  page = st.sidebar.radio("Go to", ["Home", "Edge Detection", "Segmentation", "Feature Extraction", "AI Classification"])
@@ -66,16 +63,16 @@ if page == "Home":
66
  - **Feature Extraction**
67
  - **AI Classification**
68
 
69
- Upload an image and explore how AI explains the techniques!
70
- """)
71
- uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
72
- if uploaded_file is not None:
73
- image = io.imread(uploaded_file)
74
- if image.shape[-1] == 4:
75
- image = image[:, :, :3]
76
- gray = rgb2gray(image)
77
- st.image(image, caption="Uploaded Image", use_container_width=True)
78
- st.session_state["gray"] = gray # Store for use in other pages
79
 
80
  # Edge Detection Page
81
  elif page == "Edge Detection":
@@ -161,8 +158,8 @@ def explain_ai(prompt):
161
  # App title
162
  st.title("Imaize: Smart Image Analyzer with XAI")
163
 
164
- # # Image upload section
165
- # uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"]) # Allow user to upload an image file
166
 
167
  # App Description
168
  st.markdown("""
 
49
  except Exception as e:
50
  return f"Error: {str(e)}"
51
 
 
 
 
52
  # Sidebar navigation
53
  st.sidebar.title("Navigation")
54
  page = st.sidebar.radio("Go to", ["Home", "Edge Detection", "Segmentation", "Feature Extraction", "AI Classification"])
 
63
  - **Feature Extraction**
64
  - **AI Classification**
65
 
66
+ # Upload an image and explore how AI explains the techniques!
67
+ # """)
68
+ # uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
69
+ # if uploaded_file is not None:
70
+ # image = io.imread(uploaded_file)
71
+ # if image.shape[-1] == 4:
72
+ # image = image[:, :, :3]
73
+ # gray = rgb2gray(image)
74
+ # st.image(image, caption="Uploaded Image", use_container_width=True)
75
+ # st.session_state["gray"] = gray # Store for use in other pages
76
 
77
  # Edge Detection Page
78
  elif page == "Edge Detection":
 
158
  # App title
159
  st.title("Imaize: Smart Image Analyzer with XAI")
160
 
161
+ # Image upload section
162
+ uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"]) # Allow user to upload an image file
163
 
164
  # App Description
165
  st.markdown("""