Nimzi commited on
Commit
a5b7aa4
Β·
verified Β·
1 Parent(s): 2ee8dae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -7
app.py CHANGED
@@ -149,22 +149,41 @@ if "text_result" in st.session_state:
149
  for name, link in st.session_state["text_verification"]:
150
  st.markdown(f"[πŸ”— {name}]({link})")
151
 
152
- # πŸ”Ή Image Result
153
  if "image_result" in st.session_state:
154
  st.image(st.session_state["news_image"], caption="Uploaded Image", use_column_width=True)
155
- st.info(f"πŸ–ΌοΈ **Image Analysis Result:** {st.session_state['image_result']} (Accuracy: {st.session_state['image_accuracy']}%)")
156
- st.markdown(f"[πŸ”Ž Google Reverse Image Search]({st.session_state['image_search_url']})")
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  # πŸ”Ή Video Result
159
  if "video_result" in st.session_state:
160
  st.video(st.session_state["video_url"])
 
161
  if st.session_state["video_result"] == "Fake":
162
  st.error(f"❌ **This video is Fake!** (Accuracy: {st.session_state['video_accuracy']}%)")
163
  elif st.session_state["video_result"] == "Real":
164
  st.success(f"βœ… **This video is Real!** (Accuracy: {st.session_state['video_accuracy']}%)")
165
  else:
166
  st.warning("⚠️ Unable to verify the authenticity of this video.")
167
-
168
- st.subheader("πŸ”Ž Trusted Fact-Checking Sources")
169
- for name, link in st.session_state["video_verification"]:
170
- st.markdown(f"[πŸ”— {name}]({link})")
 
 
 
 
 
 
149
  for name, link in st.session_state["text_verification"]:
150
  st.markdown(f"[πŸ”— {name}]({link})")
151
 
152
+ # πŸ”Ή Image Analysis Result Section
153
  if "image_result" in st.session_state:
154
  st.image(st.session_state["news_image"], caption="Uploaded Image", use_column_width=True)
155
+
156
+ if st.session_state["image_result"] == "Fake":
157
+ st.error(f"❌ **This image is likely Fake!** (Accuracy: {st.session_state['image_accuracy']}%)")
158
+ elif st.session_state["image_result"] == "Real":
159
+ st.success(f"βœ… **This image is likely Real!** (Accuracy: {st.session_state['image_accuracy']}%)")
160
+ else:
161
+ st.warning("⚠️ Unable to verify the authenticity of this image.")
162
+
163
+ # βœ… Add verification links
164
+ if st.session_state["image_verification"]:
165
+ st.subheader("πŸ”Ž Trusted Fact-Checking Sources")
166
+ for name, link in st.session_state["image_verification"]:
167
+ st.markdown(f"[πŸ”— {name}]({link})")
168
+ else:
169
+ st.warning("No verification sources available for this image.")
170
 
171
  # πŸ”Ή Video Result
172
  if "video_result" in st.session_state:
173
  st.video(st.session_state["video_url"])
174
+
175
  if st.session_state["video_result"] == "Fake":
176
  st.error(f"❌ **This video is Fake!** (Accuracy: {st.session_state['video_accuracy']}%)")
177
  elif st.session_state["video_result"] == "Real":
178
  st.success(f"βœ… **This video is Real!** (Accuracy: {st.session_state['video_accuracy']}%)")
179
  else:
180
  st.warning("⚠️ Unable to verify the authenticity of this video.")
181
+
182
+ # βœ… Check if verification links exist before iterating
183
+ if st.session_state["video_verification"]:
184
+ st.subheader("πŸ”Ž Trusted Fact-Checking Sources")
185
+ for name, link in st.session_state["video_verification"]:
186
+ st.markdown(f"[πŸ”— {name}]({link})")
187
+ else:
188
+ st.warning("No verification sources available for this video.")
189
+