RobotJelly commited on
Commit
2c222d2
·
1 Parent(s): 5e1a86a
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -69,12 +69,18 @@ input = [gr.inputs.Image(type="filepath", label="Ground Truth - Real Image (jpg)
69
  gr.inputs.Image(type="filepath", label="Segementated image (png)"),
70
  gr.inputs.Image(type="filepath", label="corresponding bitmap image (bmp)")]
71
 
72
- facades_data = []
73
- data_dir = 'examples/'
74
- for idx, images in enumerate(os.listdir(data_dir)):
75
- image = os.path.join(data_dir, images)
76
- if os.path.isfile(image) and idx < 6:
77
- facades_data.append(image)
 
 
 
 
 
 
78
 
79
  # output
80
  output = [gr.outputs.Image(type="numpy", label="Generated - Conditioned Images")]
@@ -82,5 +88,5 @@ output = [gr.outputs.Image(type="numpy", label="Generated - Conditioned Images")
82
  title = "GauGAN For Conditional Image Generation"
83
  description = "Upload an Image or take one from examples to generate realistic images that are conditioned on cue images and segmentation maps"
84
 
85
- gr.Interface(fn=predict, inputs = input, outputs = output, examples=facades_data, allow_flagging=False, analytics_enabled=False,
86
  title=title, description=description, article="<center>Space By: <u><a href='https://github.com/robotjellyzone'><b>Kavya Bisht</b></a></u> \n Based on <a href='https://keras.io/examples/generative/gaugan/'><b>this notebook</b></a></center>").launch(enable_queue=True, debug=True)
 
69
  gr.inputs.Image(type="filepath", label="Segementated image (png)"),
70
  gr.inputs.Image(type="filepath", label="corresponding bitmap image (bmp)")]
71
 
72
+ #facades_data = []
73
+ #data_dir = 'examples/'
74
+ #for idx, images in enumerate(os.listdir(data_dir)):
75
+ # image = os.path.join(data_dir, images)
76
+ # if os.path.isfile(image) and idx < 6:
77
+ # facades_data.append(image)
78
+
79
+ examples = [["/content/facades_data/cmp_b0010.jpg", "/content/facades_data/cmp_b0010.png", "/content/facades_data/cmp_b0010.bmp"],
80
+ ["/content/facades_data/cmp_b0020.jpg", "/content/facades_data/cmp_b0020.png", "/content/facades_data/cmp_b0020.bmp"],
81
+ ["/content/facades_data/cmp_b0030.jpg", "/content/facades_data/cmp_b0030.png", "/content/facades_data/cmp_b0030.bmp"],
82
+ ["/content/facades_data/cmp_b0040.jpg", "/content/facades_data/cmp_b0040.png", "/content/facades_data/cmp_b0040.bmp"],
83
+ ["/content/facades_data/cmp_b0050.jpg", "/content/facades_data/cmp_b0050.png", "/content/facades_data/cmp_b0050.bmp"]]
84
 
85
  # output
86
  output = [gr.outputs.Image(type="numpy", label="Generated - Conditioned Images")]
 
88
  title = "GauGAN For Conditional Image Generation"
89
  description = "Upload an Image or take one from examples to generate realistic images that are conditioned on cue images and segmentation maps"
90
 
91
+ gr.Interface(fn=predict, inputs = input, outputs = output, examples=examples, allow_flagging=False, analytics_enabled=False,
92
  title=title, description=description, article="<center>Space By: <u><a href='https://github.com/robotjellyzone'><b>Kavya Bisht</b></a></u> \n Based on <a href='https://keras.io/examples/generative/gaugan/'><b>this notebook</b></a></center>").launch(enable_queue=True, debug=True)