IbrahimHasani commited on
Commit
cbab6c8
1 Parent(s): bc74179

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -185,18 +185,17 @@ def check_object_in_image(query_image, target_image, threshold=50, scale_factor=
185
 
186
  return {
187
  'is_present': is_present,
188
- 'images': images_to_return,
189
- 'object detection inliers': [int(i) for i in cropped_inliers],
190
- 'bbox_image': bbox_image,
191
  }
192
 
193
  def interface(poster_source, media_source, threshold, scale_factor):
194
  result1 = check_object_in_image(poster_source, media_source, threshold, scale_factor)
195
  if result1['is_present']:
196
- return result1
197
 
198
  result2 = check_object_in_image(poster_source, media_source, threshold, scale_factor)
199
- return result2 if result2['is_present'] else result1
200
 
201
  iface = gr.Interface(
202
  fn=interface,
 
185
 
186
  return {
187
  'is_present': is_present,
188
+ 'image_with_boxes': bbox_image,
189
+ 'object_detection_inliers': [int(i) for i in cropped_inliers],
 
190
  }
191
 
192
  def interface(poster_source, media_source, threshold, scale_factor):
193
  result1 = check_object_in_image(poster_source, media_source, threshold, scale_factor)
194
  if result1['is_present']:
195
+ return result1['is_present'], result1['image_with_boxes']
196
 
197
  result2 = check_object_in_image(poster_source, media_source, threshold, scale_factor)
198
+ return result2['is_present'], result2['image_with_boxes']
199
 
200
  iface = gr.Interface(
201
  fn=interface,