Spaces:
Runtime error
Runtime error
removing duplication
Browse files
app.py
CHANGED
@@ -49,6 +49,7 @@ def explain_ai(prompt):
|
|
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,16 +64,16 @@ if page == "Home":
|
|
63 |
- **Feature Extraction**
|
64 |
- **AI Classification**
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
|
77 |
# Edge Detection Page
|
78 |
elif page == "Edge Detection":
|
@@ -155,11 +156,11 @@ def explain_ai(prompt):
|
|
155 |
except Exception as e:
|
156 |
return f"Error: {str(e)}" # Return error message if there's an issue
|
157 |
|
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("""
|
|
|
49 |
except Exception as e:
|
50 |
return f"Error: {str(e)}"
|
51 |
|
52 |
+
|
53 |
# Sidebar navigation
|
54 |
st.sidebar.title("Navigation")
|
55 |
page = st.sidebar.radio("Go to", ["Home", "Edge Detection", "Segmentation", "Feature Extraction", "AI Classification"])
|
|
|
64 |
- **Feature Extraction**
|
65 |
- **AI Classification**
|
66 |
|
67 |
+
Upload an image and explore how AI explains the techniques!
|
68 |
+
""")
|
69 |
+
uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
|
70 |
+
if uploaded_file is not None:
|
71 |
+
image = io.imread(uploaded_file)
|
72 |
+
if image.shape[-1] == 4:
|
73 |
+
image = image[:, :, :3]
|
74 |
+
gray = rgb2gray(image)
|
75 |
+
st.image(image, caption="Uploaded Image", use_container_width=True)
|
76 |
+
st.session_state["gray"] = gray # Store for use in other pages
|
77 |
|
78 |
# Edge Detection Page
|
79 |
elif page == "Edge Detection":
|
|
|
156 |
except Exception as e:
|
157 |
return f"Error: {str(e)}" # Return error message if there's an issue
|
158 |
|
159 |
+
# # App title
|
160 |
+
# st.title("Imaize: Smart Image Analyzer with XAI")
|
161 |
|
162 |
+
# # Image upload section
|
163 |
+
# uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"]) # Allow user to upload an image file
|
164 |
|
165 |
# App Description
|
166 |
st.markdown("""
|