sqfoo commited on
Commit
db2b50d
·
1 Parent(s): d044167

Trying to resolve

Browse files
Files changed (3) hide show
  1. __pycache__/utilspp.cpython-312.pyc +0 -0
  2. app.py +1 -1
  3. utilspp.py +27 -11
__pycache__/utilspp.cpython-312.pyc CHANGED
Binary files a/__pycache__/utilspp.cpython-312.pyc and b/__pycache__/utilspp.cpython-312.pyc differ
 
app.py CHANGED
@@ -10,7 +10,7 @@ def nowcasting(file, cfg_str, ensemble_no):
10
  # Model Setup
11
  Forecastor = InferenceHub(
12
  model_config=STLDM_HKO,
13
- cfg_str=cfg_str,
14
  model_type='HF'
15
  )
16
 
 
10
  # Model Setup
11
  Forecastor = InferenceHub(
12
  model_config=STLDM_HKO,
13
+ cfg_str=cfg_str if cfg_str > 0 else None,
14
  model_type='HF'
15
  )
16
 
utilspp.py CHANGED
@@ -144,23 +144,39 @@ def gradio_gif(sequences, T):
144
  fig, axes = plt.subplots(nrows=1, ncols=horizontal, figsize=(fig_size*horizontal, fig_size), tight_layout=True)
145
  plt.subplots_adjust(hspace=0.0, wspace=0.0) # tight layout
146
  plt.setp(axes, xticks=[], yticks=[])
147
- for i, sequence in enumerate(sequences.values()):
148
- axes[i].set_xticks([])
149
- axes[i].set_yticks([])
150
- axes[i].set_xlabel(f'Ensemble {i+1}', fontsize=12)
151
- frame = sequence[0].squeeze()
152
- im = axes[i].imshow(frame*255, cmap=ListedColormap(VIL_COLORS), \
153
- norm=BoundaryNorm(VIL_LEVELS, ListedColormap(VIL_COLORS).N), animated=True)
 
 
 
 
 
 
 
 
 
 
154
 
155
  title = fig.suptitle('', y=0.9, x=0.505, fontsize=16) # Initialize an empty super title
156
 
157
  fig.colorbar(im)
158
 
159
  def animate(t):
160
- for i, sequence in enumerate(sequences.values()):
161
- frame = sequence[t].squeeze()
162
- im = axes[i].imshow(frame*255, cmap=ListedColormap(VIL_COLORS), \
163
- norm=BoundaryNorm(VIL_LEVELS, ListedColormap(VIL_COLORS).N), animated=True)
 
 
 
 
 
 
164
  plt.subplots_adjust(hspace=0.0, wspace=0.0) # tight layout
165
 
166
  title.set_text(f'$t + {t}$') # update the title text
 
144
  fig, axes = plt.subplots(nrows=1, ncols=horizontal, figsize=(fig_size*horizontal, fig_size), tight_layout=True)
145
  plt.subplots_adjust(hspace=0.0, wspace=0.0) # tight layout
146
  plt.setp(axes, xticks=[], yticks=[])
147
+
148
+ if horizontal == 1:
149
+ for i, sequence in enumerate(sequences.values()):
150
+ axes.set_xticks([])
151
+ axes.set_yticks([])
152
+ axes.set_xlabel(f'Ensemble {i+1}', fontsize=12)
153
+ frame = sequence[0].squeeze()
154
+ im = axes.imshow(frame*255, cmap=ListedColormap(VIL_COLORS), \
155
+ norm=BoundaryNorm(VIL_LEVELS, ListedColormap(VIL_COLORS).N), animated=True)
156
+ else:
157
+ for i, sequence in enumerate(sequences.values()):
158
+ axes[i].set_xticks([])
159
+ axes[i].set_yticks([])
160
+ axes[i].set_xlabel(f'Ensemble {i+1}', fontsize=12)
161
+ frame = sequence[0].squeeze()
162
+ im = axes[i].imshow(frame*255, cmap=ListedColormap(VIL_COLORS), \
163
+ norm=BoundaryNorm(VIL_LEVELS, ListedColormap(VIL_COLORS).N), animated=True)
164
 
165
  title = fig.suptitle('', y=0.9, x=0.505, fontsize=16) # Initialize an empty super title
166
 
167
  fig.colorbar(im)
168
 
169
  def animate(t):
170
+ if horizontal == 1:
171
+ for i, sequence in enumerate(sequences.values()):
172
+ frame = sequence[t].squeeze()
173
+ im = axes.imshow(frame*255, cmap=ListedColormap(VIL_COLORS), \
174
+ norm=BoundaryNorm(VIL_LEVELS, ListedColormap(VIL_COLORS).N), animated=True)
175
+ else:
176
+ for i, sequence in enumerate(sequences.values()):
177
+ frame = sequence[t].squeeze()
178
+ im = axes[i].imshow(frame*255, cmap=ListedColormap(VIL_COLORS), \
179
+ norm=BoundaryNorm(VIL_LEVELS, ListedColormap(VIL_COLORS).N), animated=True)
180
  plt.subplots_adjust(hspace=0.0, wspace=0.0) # tight layout
181
 
182
  title.set_text(f'$t + {t}$') # update the title text