kargaranamir HF Staff commited on
Commit
861d8fa
·
verified ·
1 Parent(s): ff81829
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
2
  import torch
3
  from visual_clutter import Vlc
4
 
5
-
6
  def inference(img):
7
  clt = Vlc(img.name, numlevels=3, contrast_filt_sigma=1, contrast_pool_sigma=3, color_pool_sigma=3, prefix='test')
8
  # get Feature Congestion clutter of a test map:
@@ -14,16 +13,16 @@ def inference(img):
14
  title = 'Visual Clutter'
15
  description = 'Compute two measures of visual clutter (Feature Congestion and Subband Entropy), see the code at https://github.com/kargaranamir/visual-clutter'
16
  article = "<p style='text-align: center'></p>"
17
- examples = [['test.jpg'],['test2.jpg']]
18
  css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
19
 
20
  gr.Interface(
21
  inference,
22
- [gr.inputs.Image(type='file', label='Input')],
23
- [gr.outputs.Image(type='file', label='Feature Congestion Output Image'), gr.outputs.Textbox(type="str", label="Feature Congestion"), gr.outputs.Textbox(type="str", label="Subband Entorpy")],
24
  title=title,
25
  description=description,
26
  article=article,
27
  examples=examples,
28
  css=css,
29
- ).launch(debug=True, enable_queue=True)
 
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:
 
13
  title = 'Visual Clutter'
14
  description = 'Compute two measures of visual clutter (Feature Congestion and Subband Entropy), see the code at https://github.com/kargaranamir/visual-clutter'
15
  article = "<p style='text-align: center'></p>"
16
+ examples = [['test.jpg'], ['test2.jpg']]
17
  css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
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)