basementparking commited on
Commit
3bca0bd
·
verified ·
1 Parent(s): 2b413f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -225,7 +225,7 @@ def segment_image(image):
225
  # overlayed_img_modernity_pil = Image.fromarray(cv2.cvtColor(overlayed_img_modernity, cv2.COLOR_BGR2RGB))
226
  # overlayed_img_typicality_pil = Image.fromarray(cv2.cvtColor(overlayed_img_typicality, cv2.COLOR_BGR2RGB))
227
 
228
- return "Automobiles detected in the image", cropped_car_pil, modernity_scores, typicality_scores , most_similar_group#, overlayed_img_modernity_pil, overlayed_img_typicality_pil
229
 
230
 
231
  # Create Gradio interface
@@ -238,8 +238,8 @@ iface = gr.Interface(
238
  gr.Textbox(label="Modernity Score"),
239
  gr.Textbox(label="Typicality Score"),
240
  gr.Textbox(label="most_similar_group"),
241
- gr.Image(label="Grad-CAM for Type"),
242
- gr.Image(label="Grad-CAM for Year")
243
  ],
244
  title="Automobile Detection and Scoring using Mask R-CNN",
245
  description="Upload an image, and the system will detect and segment automobiles, crop the largest car, and predict its modernity and typicality scores. Grad-CAM heatmaps will also be generated."
 
225
  # overlayed_img_modernity_pil = Image.fromarray(cv2.cvtColor(overlayed_img_modernity, cv2.COLOR_BGR2RGB))
226
  # overlayed_img_typicality_pil = Image.fromarray(cv2.cvtColor(overlayed_img_typicality, cv2.COLOR_BGR2RGB))
227
 
228
+ return "Automobiles detected in the image", cropped_car_pil, modernity_scores, typicality_scores , most_similar_group, overlayed_img_modernity_pil, overlayed_img_typicality_pil
229
 
230
 
231
  # Create Gradio interface
 
238
  gr.Textbox(label="Modernity Score"),
239
  gr.Textbox(label="Typicality Score"),
240
  gr.Textbox(label="most_similar_group"),
241
+ gr.Image(label="Grad-CAM for Year"),
242
+ gr.Image(label="Grad-CAM for Type")
243
  ],
244
  title="Automobile Detection and Scoring using Mask R-CNN",
245
  description="Upload an image, and the system will detect and segment automobiles, crop the largest car, and predict its modernity and typicality scores. Grad-CAM heatmaps will also be generated."