kargaranamir commited on
Commit
5473cc1
·
verified ·
1 Parent(s): 861d8fa
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
2
  import torch
3
  from visual_clutter import Vlc
4
 
5
- def inference(img):
6
- clt = Vlc(img.name, numlevels=3, contrast_filt_sigma=1, contrast_pool_sigma=3, color_pool_sigma=3, prefix='test')
7
  # get Feature Congestion clutter of a test map:
8
  clutter_scalar_fc, clutter_map_fc = clt.getClutter_FC(p=1, pix=1)
9
  # get Subband Entropy clutter of the test map:
@@ -18,11 +18,11 @@ css = ".output_image, .input_image {height: 40rem !important; width: 100% !impor
18
 
19
  gr.Interface(
20
  inference,
21
- [gr.Image(type='file', label='Input')],
22
- [gr.Image(type='file', label='Feature Congestion Output Image'), gr.Textbox(label="Feature Congestion"), gr.Textbox(label="Subband Entropy")],
23
  title=title,
24
  description=description,
25
  article=article,
26
  examples=examples,
27
  css=css,
28
- ).launch(debug=True, enable_queue=True)
 
2
  import torch
3
  from visual_clutter import Vlc
4
 
5
+ def inference(img_path):
6
+ clt = Vlc(img_path, numlevels=3, contrast_filt_sigma=1, contrast_pool_sigma=3, color_pool_sigma=3, prefix='test')
7
  # get Feature Congestion clutter of a test map:
8
  clutter_scalar_fc, clutter_map_fc = clt.getClutter_FC(p=1, pix=1)
9
  # get Subband Entropy clutter of the test map:
 
18
 
19
  gr.Interface(
20
  inference,
21
+ [gr.Image(type='file_path', label='Input')],
22
+ [gr.Image(type='file_path', label='Feature Congestion Output Image'), gr.Textbox(label="Feature Congestion"), gr.Textbox(label="Subband Entropy")],
23
  title=title,
24
  description=description,
25
  article=article,
26
  examples=examples,
27
  css=css,
28
+ ).launch(debug=True)