umyuu commited on
Commit
35e7d15
1 Parent(s): 23f64b3

関数内のログ出力レベルをdebugに変更します。

Browse files
Files changed (2) hide show
  1. app.py +4 -7
  2. config.json +1 -1
app.py CHANGED
@@ -84,17 +84,17 @@ def submit_clicked(image: np.ndarray, algorithm: Literal["SpectralResidual", "Fi
84
  log.info(f"#submit_clicked({sw.elapsed:.3f}s)")
85
  #
86
  saliency = SaliencyMap(algorithm)
87
- log.info(f"#SaliencyMap({sw.elapsed:.3f}s)")
88
  success, saliency_map = saliency.compute(image)
89
- log.info(f"#compute({sw.elapsed:.3f}s)")
90
 
91
  if not success:
92
  return image, image # エラーが発生した場合は入力画像を返します。
93
 
94
- log.info(f"#jet({sw.elapsed:.3f}s)")
95
  jet = convert_colormap(image, saliency_map, "jet")
96
  # jet = None
97
- log.info(f"#hot({sw.elapsed:.3f}s)")
98
  hot = convert_colormap(image, saliency_map, "hot")
99
  saliency = None
100
  log.info(f"#submit_clicked({sw.elapsed:.3f}s)")
@@ -166,7 +166,6 @@ with gr.Blocks(
166
 
167
 
168
  if __name__ == "__main__":
169
- log.info(f"#launch({watch.elapsed:.3f}s)")
170
  # アプリを起動します。
171
  # https://www.gradio.app/docs/gradio/blocks#blocks-launch
172
  demo.launch(
@@ -175,5 +174,3 @@ if __name__ == "__main__":
175
  server_port=args.server_port,
176
  max_file_size=args.max_file_size,
177
  )
178
-
179
- log.info(f"#Hot Reload完了({watch.elapsed:.3f}s)")
 
84
  log.info(f"#submit_clicked({sw.elapsed:.3f}s)")
85
  #
86
  saliency = SaliencyMap(algorithm)
87
+ log.debug(f"#SaliencyMap({sw.elapsed:.3f}s)")
88
  success, saliency_map = saliency.compute(image)
89
+ log.debug(f"#compute({sw.elapsed:.3f}s)")
90
 
91
  if not success:
92
  return image, image # エラーが発生した場合は入力画像を返します。
93
 
94
+ log.debug(f"#jet({sw.elapsed:.3f}s)")
95
  jet = convert_colormap(image, saliency_map, "jet")
96
  # jet = None
97
+ log.debug(f"#hot({sw.elapsed:.3f}s)")
98
  hot = convert_colormap(image, saliency_map, "hot")
99
  saliency = None
100
  log.info(f"#submit_clicked({sw.elapsed:.3f}s)")
 
166
 
167
 
168
  if __name__ == "__main__":
 
169
  # アプリを起動します。
170
  # https://www.gradio.app/docs/gradio/blocks#blocks-launch
171
  demo.launch(
 
174
  server_port=args.server_port,
175
  max_file_size=args.max_file_size,
176
  )
 
 
config.json CHANGED
@@ -26,7 +26,7 @@
26
  "handlers": {
27
  "console1": {
28
  "class": "logging.StreamHandler",
29
- "level": "DEBUG",
30
  "formatter": "jst"
31
  }
32
  },
 
26
  "handlers": {
27
  "console1": {
28
  "class": "logging.StreamHandler",
29
+ "level": "INFO",
30
  "formatter": "jst"
31
  }
32
  },