Upgrade to Streamlit 1.40 + TF 2.20 (resolves protobuf conflict); fix use_container_width
Browse files- app.py +3 -3
- requirements.txt +8 -8
app.py
CHANGED
|
@@ -133,7 +133,7 @@ if uploaded_file is not None:
|
|
| 133 |
|
| 134 |
col1, col2 = st.columns(2)
|
| 135 |
with col1:
|
| 136 |
-
st.image(image, caption="Original Image",
|
| 137 |
|
| 138 |
with st.spinner("Analyzing..."):
|
| 139 |
# Load model
|
|
@@ -167,7 +167,7 @@ if uploaded_file is not None:
|
|
| 167 |
col3, col4 = st.columns(2)
|
| 168 |
with col3:
|
| 169 |
st.subheader("ELA Artifacts")
|
| 170 |
-
st.image(ela_img, caption="Error Level Analysis (JPEG inconsistencies)",
|
| 171 |
st.info("ELA highlights regions with different compression levels, often indicating tampered areas.")
|
| 172 |
|
| 173 |
with col4:
|
|
@@ -181,7 +181,7 @@ if uploaded_file is not None:
|
|
| 181 |
# Blend
|
| 182 |
img_np = np.array(image)
|
| 183 |
overlay = np.uint8(heatmap_resized * 0.4 + img_np * 0.6)
|
| 184 |
-
st.image(overlay, caption="Model Focus Regions",
|
| 185 |
st.info("The heatmap shows which parts of the image the model focused on to make its decision.")
|
| 186 |
except Exception as e:
|
| 187 |
st.error(f"Could not generate Grad-CAM: {e}")
|
|
|
|
| 133 |
|
| 134 |
col1, col2 = st.columns(2)
|
| 135 |
with col1:
|
| 136 |
+
st.image(image, caption="Original Image", use_container_width=True)
|
| 137 |
|
| 138 |
with st.spinner("Analyzing..."):
|
| 139 |
# Load model
|
|
|
|
| 167 |
col3, col4 = st.columns(2)
|
| 168 |
with col3:
|
| 169 |
st.subheader("ELA Artifacts")
|
| 170 |
+
st.image(ela_img, caption="Error Level Analysis (JPEG inconsistencies)", use_container_width=True)
|
| 171 |
st.info("ELA highlights regions with different compression levels, often indicating tampered areas.")
|
| 172 |
|
| 173 |
with col4:
|
|
|
|
| 181 |
# Blend
|
| 182 |
img_np = np.array(image)
|
| 183 |
overlay = np.uint8(heatmap_resized * 0.4 + img_np * 0.6)
|
| 184 |
+
st.image(overlay, caption="Model Focus Regions", use_container_width=True)
|
| 185 |
st.info("The heatmap shows which parts of the image the model focused on to make its decision.")
|
| 186 |
except Exception as e:
|
| 187 |
st.error(f"Could not generate Grad-CAM: {e}")
|
requirements.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
streamlit==1.
|
| 2 |
-
tensorflow
|
| 3 |
-
opencv-python-headless==4.
|
| 4 |
-
pillow==10.
|
| 5 |
-
numpy==1.
|
| 6 |
-
scikit-learn==1.
|
| 7 |
-
matplotlib==3.
|
| 8 |
-
huggingface-hub==0.
|
|
|
|
| 1 |
+
streamlit==1.40.2
|
| 2 |
+
tensorflow==2.20.0
|
| 3 |
+
opencv-python-headless==4.10.0.84
|
| 4 |
+
pillow==10.4.0
|
| 5 |
+
numpy==1.26.4
|
| 6 |
+
scikit-learn==1.5.2
|
| 7 |
+
matplotlib==3.9.2
|
| 8 |
+
huggingface-hub==0.25.2
|