polejowska commited on
Commit
27e0297
1 Parent(s): da20a6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -7
app.py CHANGED
@@ -22,7 +22,6 @@ def make_prediction(img, feature_extractor, model):
22
  processed_outputs[0],
23
  outputs["decoder_attentions"],
24
  outputs["encoder_attentions"],
25
- # outputs["cross_attentions"],
26
  )
27
 
28
 
@@ -37,7 +36,6 @@ def detect_objects(model_name, image_input, threshold, display_mask=False, img_i
37
  processed_outputs,
38
  decoder_attention_map,
39
  encoder_attention_map,
40
- # cross_attention_map,
41
  ) = make_prediction(image_input, feature_extractor, model)
42
 
43
  viz_img = visualize_prediction(
@@ -54,13 +52,11 @@ def detect_objects(model_name, image_input, threshold, display_mask=False, img_i
54
  encoder_attention_map_img = visualize_attention_map(
55
  image_input, encoder_attention_map
56
  )
57
- # cross_attention_map_img = visualize_attention_map(image_input, cross_attention_map)
58
 
59
  return (
60
  viz_img,
61
  decoder_attention_map_img,
62
  encoder_attention_map_img,
63
- # cross_attention_map_img,
64
  model_details
65
  )
66
 
@@ -123,9 +119,6 @@ with gr.Blocks(css=css) as app:
123
  gr.Markdown("""Decoder attentions""")
124
  with gr.Row():
125
  decoder_att_map_output = gr.Image(shape=(850, 850))
126
- # gr.Markdown("""Cross attentions""")
127
- # with gr.Row():
128
- # cross_att_map_output = gr.Image(shape=(850, 850))
129
  with gr.TabItem("Model details"):
130
  with gr.Row():
131
  model_details = gr.Markdown(""" """)
 
22
  processed_outputs[0],
23
  outputs["decoder_attentions"],
24
  outputs["encoder_attentions"],
 
25
  )
26
 
27
 
 
36
  processed_outputs,
37
  decoder_attention_map,
38
  encoder_attention_map,
 
39
  ) = make_prediction(image_input, feature_extractor, model)
40
 
41
  viz_img = visualize_prediction(
 
52
  encoder_attention_map_img = visualize_attention_map(
53
  image_input, encoder_attention_map
54
  )
 
55
 
56
  return (
57
  viz_img,
58
  decoder_attention_map_img,
59
  encoder_attention_map_img,
 
60
  model_details
61
  )
62
 
 
119
  gr.Markdown("""Decoder attentions""")
120
  with gr.Row():
121
  decoder_att_map_output = gr.Image(shape=(850, 850))
 
 
 
122
  with gr.TabItem("Model details"):
123
  with gr.Row():
124
  model_details = gr.Markdown(""" """)