usamaalam commited on
Commit
93ab4cb
·
1 Parent(s): 48027b6

Upgrade to Streamlit 1.40 + TF 2.20 (resolves protobuf conflict); fix use_container_width

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. 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", use_column_width=True)
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)", use_column_width=True)
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", use_column_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}")
 
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.35.0
2
- tensorflow-cpu==2.15.0
3
- opencv-python-headless==4.8.1.78
4
- pillow==10.0.0
5
- numpy==1.24.3
6
- scikit-learn==1.3.2
7
- matplotlib==3.8.0
8
- huggingface-hub==0.19.4
 
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