vict0rsch commited on
Commit
51920a8
1 Parent(s): ac09955

update reqs

Browse files
Files changed (3) hide show
  1. app.py +18 -4
  2. climategan_wrapper.py +3 -0
  3. requirements.txt +2 -1
app.py CHANGED
@@ -42,7 +42,7 @@ def predict(cg: ClimateGAN, api_key):
42
  masked_input = output_dict["masked_input"]
43
  wildfire = output_dict["wildfire"]
44
  smog = output_dict["smog"]
45
- depth = np.repeat(output_dict["depth"][..., None], 3, axis=-1)
46
  segmentation = output_dict["segmentation"]
47
 
48
  climategan_flood = output_dict.get(
@@ -145,19 +145,27 @@ if __name__ == "__main__":
145
  gr.HTML(
146
  dedent(
147
  """
 
 
 
 
 
 
148
  <p style='text-align: center'>
149
  Visit
150
  <a href='https://thisclimatedoesnotexist.com/'>
151
  ThisClimateDoesNotExist.com
152
  </a>
153
- for more information.
154
- |
155
  Original
156
  <a href='https://github.com/cc-ai/climategan'>
157
  ClimateGAN GitHub Repo
158
  </a>
159
  </p>
160
 
 
 
161
  <p>
162
  After you have selected an image and started the inference you
163
  will see all the outputs of ClimateGAN, including intermediate
@@ -165,12 +173,18 @@ if __name__ == "__main__":
165
  depth maps used to produce the 3 events.
166
  </p>
167
 
 
 
168
  <p>
169
  This Space makes use of recent Stable Diffusion in-painting
170
  pipelines to replace ClimateGAN's original Painter. If you
171
  select 'Both' painters, you will see a comparison
172
  </p>
173
 
 
 
 
 
174
  <p>
175
  Read the original
176
  <a
@@ -201,7 +215,7 @@ if __name__ == "__main__":
201
  default="Both",
202
  )
203
  ]
204
- btn = gr.Button("See for yourself!", label="Run")
205
  with gr.Row():
206
  gr.Markdown("## Outputs")
207
  with gr.Row():
 
42
  masked_input = output_dict["masked_input"]
43
  wildfire = output_dict["wildfire"]
44
  smog = output_dict["smog"]
45
+ depth = np.repeat(output_dict["depth"], 3, axis=-1)
46
  segmentation = output_dict["segmentation"]
47
 
48
  climategan_flood = output_dict.get(
 
145
  gr.HTML(
146
  dedent(
147
  """
148
+
149
+ <br>
150
+ <br>
151
+ <br>
152
+
153
+
154
  <p style='text-align: center'>
155
  Visit
156
  <a href='https://thisclimatedoesnotexist.com/'>
157
  ThisClimateDoesNotExist.com
158
  </a>
159
+ for more information
160
+ &nbsp;&nbsp;|&nbsp;&nbsp;
161
  Original
162
  <a href='https://github.com/cc-ai/climategan'>
163
  ClimateGAN GitHub Repo
164
  </a>
165
  </p>
166
 
167
+ <br>
168
+
169
  <p>
170
  After you have selected an image and started the inference you
171
  will see all the outputs of ClimateGAN, including intermediate
 
173
  depth maps used to produce the 3 events.
174
  </p>
175
 
176
+ <br>
177
+
178
  <p>
179
  This Space makes use of recent Stable Diffusion in-painting
180
  pipelines to replace ClimateGAN's original Painter. If you
181
  select 'Both' painters, you will see a comparison
182
  </p>
183
 
184
+ <br>
185
+
186
+ <br>
187
+
188
  <p>
189
  Read the original
190
  <a
 
215
  default="Both",
216
  )
217
  ]
218
+ btn = gr.Button("See for yourself!", label="Run", variant="primary")
219
  with gr.Row():
220
  gr.Markdown("## Outputs")
221
  with gr.Row():
climategan_wrapper.py CHANGED
@@ -250,7 +250,10 @@ class ClimateGAN:
250
  "concat": np.random.randint(0, 255, (640, 640 * 5, 3)),
251
  "smog": np.random.randint(0, 255, (640, 640, 3)),
252
  "wildfire": np.random.randint(0, 255, (640, 640, 3)),
 
 
253
  }
 
254
 
255
  image_array = (
256
  np.array(Image.open(orig_image))
 
250
  "concat": np.random.randint(0, 255, (640, 640 * 5, 3)),
251
  "smog": np.random.randint(0, 255, (640, 640, 3)),
252
  "wildfire": np.random.randint(0, 255, (640, 640, 3)),
253
+ "depth": np.random.randint(0, 255, (640, 640, 1)),
254
+ "segmentation": np.random.randint(0, 255, (640, 640, 3)),
255
  }
256
+ return
257
 
258
  image_array = (
259
  np.array(Image.open(orig_image))
requirements.txt CHANGED
@@ -146,7 +146,8 @@ threadpoolctl==2.2.0
146
  tifffile==2021.8.30
147
  tokenizers==0.13.1
148
  tomli==2.0.1
149
- torch==1.7.1
 
150
  torch-optimizer==0.1.0
151
  torchvision==0.8.2
152
  tqdm==4.62.2
 
146
  tifffile==2021.8.30
147
  tokenizers==0.13.1
148
  tomli==2.0.1
149
+ --extra-index-url https://download.pytorch.org/whl/cu113
150
+ torch
151
  torch-optimizer==0.1.0
152
  torchvision==0.8.2
153
  tqdm==4.62.2