m7mdal7aj commited on
Commit
f05f048
1 Parent(s): aebc520

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -34,9 +34,7 @@ sample_images = ["Files/sample1.jpg", "Files/sample2.jpg", "Files/sample3.jpg",
34
 
35
 
36
  def analyze_image(image, model):
37
- # Placeholder for your analysis function
38
- # This function should prepare captions, detect objects, etc.
39
- # For example:
40
  caption = model.get_caption(image)
41
  image_with_boxes, detected_objects_str = model.detect_objects(image)
42
  return caption, detected_objects_str
@@ -147,6 +145,7 @@ def run_inference():
147
  else:
148
  # Call the function to load models and show progress
149
  st.session_state['kbvqa'] = prepare_kbvqa_model(detection_model)
 
150
 
151
  if st.session_state['kbvqa']:
152
  st.write("Model is ready for inference.")
@@ -161,7 +160,7 @@ def run_inference():
161
  # Main function
162
  def main():
163
  st.sidebar.title("Navigation")
164
- selection = st.sidebar.radio("Go to", ["Home", "Dataset Analysis", "Evaluation Results", "Run Inference", "Dissertation Report", "Object Detection"])
165
 
166
  if selection == "Home":
167
  st.title("MultiModal Learning for Knowledg-Based Visual Question Answering")
@@ -191,9 +190,12 @@ def main():
191
 
192
  elif selection == "Run Inference":
193
  run_inference()
 
 
 
 
194
 
195
- elif selection == "Object Detection":
196
- run_object_detection()
197
 
198
  if __name__ == "__main__":
199
  main()
 
34
 
35
 
36
  def analyze_image(image, model):
37
+ st.write("Analyzing . . .")
 
 
38
  caption = model.get_caption(image)
39
  image_with_boxes, detected_objects_str = model.detect_objects(image)
40
  return caption, detected_objects_str
 
145
  else:
146
  # Call the function to load models and show progress
147
  st.session_state['kbvqa'] = prepare_kbvqa_model(detection_model)
148
+ st.session_state['kbvqa'].detection_confidence = confidence_level
149
 
150
  if st.session_state['kbvqa']:
151
  st.write("Model is ready for inference.")
 
160
  # Main function
161
  def main():
162
  st.sidebar.title("Navigation")
163
+ selection = st.sidebar.radio("Go to", ["Home", "Dataset Analysis", "Evaluation Results", "Run Inference", "Dissertation Report", "More Pages will follow .. "])
164
 
165
  if selection == "Home":
166
  st.title("MultiModal Learning for Knowledg-Based Visual Question Answering")
 
190
 
191
  elif selection == "Run Inference":
192
  run_inference()
193
+
194
+ elif selection == "More Pages will follow .. ":
195
+ st.title("Staye Tuned")
196
+ st.write("This is a Place Holder until the contents are uploaded.")
197
 
198
+
 
199
 
200
  if __name__ == "__main__":
201
  main()