lmoss commited on
Commit
607ad84
·
1 Parent(s): db17392

small code cleanup

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -89,6 +89,9 @@ st.markdown(
89
  """
90
  , unsafe_allow_html=True)
91
 
 
 
 
92
  model_fname = "berea_generator_epoch_24.pth"
93
  checkpoint_url = "https://github.com/LukasMosser/PorousMediaGan/blob/master/checkpoints/berea/{0:}?raw=true".format(model_fname)
94
 
@@ -100,12 +103,12 @@ slices, mesh, dist = create_uniform_mesh_marching_cubes(img)
100
 
101
  pv.set_plot_theme("document")
102
  pl = pv.Plotter(shape=(1, 1),
103
- window_size=(400, 400))
104
  _ = pl.add_mesh(slices, cmap="gray")
105
  pl.export_html('slices.html')
106
 
107
  pl = pv.Plotter(shape=(1, 1),
108
- window_size=(400, 400))
109
  _ = pl.add_mesh(mesh, scalars=dist)
110
  pl.export_html('mesh.html')
111
 
@@ -113,8 +116,7 @@ st.header("2D Cross-Section of Generated Volume")
113
  fig = create_matplotlib_figure(img, img.shape[0]//2)
114
  st.pyplot(fig=fig)
115
 
116
- view_width = 400
117
- view_height = 400
118
 
119
  HtmlFile = open("slices.html", 'r', encoding='utf-8')
120
  source_code = HtmlFile.read()
 
89
  """
90
  , unsafe_allow_html=True)
91
 
92
+ view_width = 400
93
+ view_height = 400
94
+
95
  model_fname = "berea_generator_epoch_24.pth"
96
  checkpoint_url = "https://github.com/LukasMosser/PorousMediaGan/blob/master/checkpoints/berea/{0:}?raw=true".format(model_fname)
97
 
 
103
 
104
  pv.set_plot_theme("document")
105
  pl = pv.Plotter(shape=(1, 1),
106
+ window_size=(view_width, view_height))
107
  _ = pl.add_mesh(slices, cmap="gray")
108
  pl.export_html('slices.html')
109
 
110
  pl = pv.Plotter(shape=(1, 1),
111
+ window_size=(view_width, view_height))
112
  _ = pl.add_mesh(mesh, scalars=dist)
113
  pl.export_html('mesh.html')
114
 
 
116
  fig = create_matplotlib_figure(img, img.shape[0]//2)
117
  st.pyplot(fig=fig)
118
 
119
+
 
120
 
121
  HtmlFile = open("slices.html", 'r', encoding='utf-8')
122
  source_code = HtmlFile.read()