artelabsuper commited on
Commit
d8f83ab
1 Parent(s): ad62063

scaling to speedup

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -9,6 +9,7 @@ from models.modelNetA import Generator as GA
9
  from models.modelNetB import Generator as GB
10
  from models.modelNetC import Generator as GC
11
 
 
12
  # load model
13
  modeltype2path = {
14
  'ModelA': 'DTM_exp_train10%_model_a/g-best.pth',
@@ -59,8 +60,8 @@ def predict(input_image, model_name):
59
  iface = gr.Interface(
60
  fn=predict,
61
  inputs=[
62
- gr.Image(shape=(512,512)),
63
- gr.inputs.Radio(MODELS_TYPE)
64
  ],
65
  outputs=[
66
  gr.Text(),
@@ -71,6 +72,6 @@ iface = gr.Interface(
71
  ["demo_imgs/fake.jpg", MODELS_TYPE[0]] # use real image
72
  ],
73
  title="Super Resolution and DTM Estimation",
74
- description="This demo predict Super Resolution and (Super Resolution) DTM from a Grayscale image (if RGB we convert it)."
75
  )
76
  iface.launch()
 
9
  from models.modelNetB import Generator as GB
10
  from models.modelNetC import Generator as GC
11
 
12
+ scale_size = 128
13
  # load model
14
  modeltype2path = {
15
  'ModelA': 'DTM_exp_train10%_model_a/g-best.pth',
 
60
  iface = gr.Interface(
61
  fn=predict,
62
  inputs=[
63
+ gr.Image(shape=(scale_size,scale_size)),
64
+ gr.inputs.Radio(MODELS_TYPE)
65
  ],
66
  outputs=[
67
  gr.Text(),
 
72
  ["demo_imgs/fake.jpg", MODELS_TYPE[0]] # use real image
73
  ],
74
  title="Super Resolution and DTM Estimation",
75
+ description=f"This demo predict Super Resolution and (Super Resolution) DTM from a Grayscale image (if RGB we convert it, for demo reason input is scale to {scale_size}x{scale_size})."
76
  )
77
  iface.launch()