Rodrigo_Cobo commited on
Commit
faac476
1 Parent(s): 4b2bdc6

added multiple dimensions

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -8,7 +8,7 @@ import matplotlib.pyplot as plt
8
  from PIL import Image
9
  import subprocess
10
 
11
- def calculate_depth(model_type, gan_type, slider, img):
12
 
13
  if not os.path.exists('temp'):
14
  os.system('mkdir temp')
@@ -51,7 +51,6 @@ def calculate_depth(model_type, gan_type, slider, img):
51
  out_im = Image.fromarray(formatted)
52
  out_im.save("Images/Input-Test/1_d.png", "PNG")
53
 
54
- dim = '256'
55
  c_images = '1'
56
  name_output = 'out'
57
 
@@ -71,9 +70,12 @@ with gr.Blocks() as demo:
71
  ## Depth Estimation
72
  midas_models = ["DPT_Large","DPT_Hybrid","MiDaS_small"]
73
  gan_models = ["Cycle","Cycle(half)","noCycle","noCycle-noCr","noCycle-noCr-noL1","OnlyGen"]
 
74
 
75
- inp = [gr.inputs.Dropdown(midas_models, default="MiDaS_small", label="Depth estimation model type")]
76
- inp.append(gr.inputs.Dropdown(gan_models, default="Cycle", label="Different Gan trainings"))
 
 
77
  inp.append(gr.Slider(1,15, default = 2, label='StepCycles',step= 1))
78
  with gr.Row():
79
  inp.append(gr.Image(type="pil", label="Input"))
@@ -81,7 +83,7 @@ with gr.Blocks() as demo:
81
  with gr.Row():
82
  out.append(gr.Image(type="file", label="Output_images"))
83
  out.append(gr.Image(type="file", label="Output_wiggle"))
84
- btn = gr.Button("Calculate depth + wiggle")
85
  btn.click(fn=calculate_depth, inputs=inp, outputs=out)
86
 
87
 
 
8
  from PIL import Image
9
  import subprocess
10
 
11
+ def calculate_depth(model_type, gan_type, dim, slider, img):
12
 
13
  if not os.path.exists('temp'):
14
  os.system('mkdir temp')
 
51
  out_im = Image.fromarray(formatted)
52
  out_im.save("Images/Input-Test/1_d.png", "PNG")
53
 
 
54
  c_images = '1'
55
  name_output = 'out'
56
 
 
70
  ## Depth Estimation
71
  midas_models = ["DPT_Large","DPT_Hybrid","MiDaS_small"]
72
  gan_models = ["Cycle","Cycle(half)","noCycle","noCycle-noCr","noCycle-noCr-noL1","OnlyGen"]
73
+ dim = ['256','512','1024']
74
 
75
+ with gr.Row():
76
+ inp = [gr.inputs.Dropdown(midas_models, default="MiDaS_small", label="Depth estimation model type")]
77
+ inp.append(gr.inputs.Dropdown(gan_models, default="Cycle", label="Different GAN trainings"))
78
+ inp.append(gr.inputs.Dropdown(dim, default="256", label="Wiggle dimension result"))
79
  inp.append(gr.Slider(1,15, default = 2, label='StepCycles',step= 1))
80
  with gr.Row():
81
  inp.append(gr.Image(type="pil", label="Input"))
 
83
  with gr.Row():
84
  out.append(gr.Image(type="file", label="Output_images"))
85
  out.append(gr.Image(type="file", label="Output_wiggle"))
86
+ btn = gr.Button("Calculate depth + Wiggle")
87
  btn.click(fn=calculate_depth, inputs=inp, outputs=out)
88
 
89