Rodrigo_Cobo
commited on
Commit
·
491b981
1
Parent(s):
0392be4
added other gans
Browse files
app.py
CHANGED
@@ -53,14 +53,16 @@ def calculate_depth(model_type, img):
|
|
53 |
|
54 |
return out_im
|
55 |
|
56 |
-
def wiggle_effect(slider):
|
57 |
|
58 |
dim = '256'
|
59 |
c_images = '1'
|
60 |
name_output = 'out'
|
61 |
|
|
|
|
|
62 |
subprocess.run(["python", "main.py", "--gan_type", 'WiggleGAN', "--expandGen", "4", "--expandDis", "4", "--batch_size", c_images, "--cIm", c_images,
|
63 |
-
"--visdom", "false", "--wiggleDepth", str(slider), "--seedLoad",
|
64 |
])
|
65 |
subprocess.run(["python", "WiggleResults/split.py", "--dim", dim])
|
66 |
|
@@ -82,7 +84,9 @@ with gr.Blocks() as demo:
|
|
82 |
|
83 |
|
84 |
## Wigglegram
|
|
|
85 |
inp = [gr.Slider(1,15, default = 2, label='StepCycles',step= 1)]
|
|
|
86 |
with gr.Row():
|
87 |
out = [ gr.Image(type="file", label="Output_images"), #TODO change to gallery
|
88 |
gr.Image(type="file", label="Output_wiggle")]
|
|
|
53 |
|
54 |
return out_im
|
55 |
|
56 |
+
def wiggle_effect(slider, gan_type):
|
57 |
|
58 |
dim = '256'
|
59 |
c_images = '1'
|
60 |
name_output = 'out'
|
61 |
|
62 |
+
dict_saved_gans = {'Cycle': '74962_110', 'Cycle(half)': '66942','noCycle': '31219_110', 'noCycle-noCr': '92332_110', 'noCycle-noCr-noL1': '82122_110', 'OnlyGen': '70944_110' }
|
63 |
+
|
64 |
subprocess.run(["python", "main.py", "--gan_type", 'WiggleGAN', "--expandGen", "4", "--expandDis", "4", "--batch_size", c_images, "--cIm", c_images,
|
65 |
+
"--visdom", "false", "--wiggleDepth", str(slider), "--seedLoad", dict_saved_gans[gan_type], "--gpu_mode", "false", "--imageDim", dim, "--name_wiggle", name_output
|
66 |
])
|
67 |
subprocess.run(["python", "WiggleResults/split.py", "--dim", dim])
|
68 |
|
|
|
84 |
|
85 |
|
86 |
## Wigglegram
|
87 |
+
gan_models = ["Cycle","Cycle(half)","noCycle","noCycle-noCr","noCycle-noCr-noL1","OnlyGen"]
|
88 |
inp = [gr.Slider(1,15, default = 2, label='StepCycles',step= 1)]
|
89 |
+
inp.append(gr.inputs.Dropdown(gan_models, default="Cycle", label="Different Gan trainings"))
|
90 |
with gr.Row():
|
91 |
out = [ gr.Image(type="file", label="Output_images"), #TODO change to gallery
|
92 |
gr.Image(type="file", label="Output_wiggle")]
|