Spaces:
Sleeping
Sleeping
marta-marta
commited on
Commit
·
6f15aad
1
Parent(s):
39da866
Modified the output size of the interpolations for readability
Browse files
app.py
CHANGED
@@ -338,7 +338,6 @@ latent_point_2 = encoder_model_boxes.predict(number_2_expand)[0]
|
|
338 |
latent_dimensionality = len(latent_point_1) # define the dimensionality of the latent space
|
339 |
########################################################################################################################
|
340 |
# Establish the Framework for a LINEAR Interpolation
|
341 |
-
# number_internal = int(interp_length) # the number of interpolations that the model will find between two points
|
342 |
num_interp = int(interp_length) # the number of images to be pictured
|
343 |
latent_matrix = [] # This will contain the latent points of the interpolation
|
344 |
for column in range(latent_dimensionality):
|
@@ -348,10 +347,7 @@ latent_matrix = np.array(latent_matrix).T # Transposes the matrix so that each
|
|
348 |
########################################################################################################################
|
349 |
# Plotting the Interpolation in 2D Using Chosen Points
|
350 |
if st.button("Generate Linear Interpolation"):
|
351 |
-
# plt.figure(2)
|
352 |
-
|
353 |
linear_interp_latent = np.linspace(latent_point_1, latent_point_2, num_interp)
|
354 |
-
print(len(linear_interp_latent))
|
355 |
|
356 |
linear_predicted_interps = []
|
357 |
figure_2 = np.zeros((28, 28 * num_interp))
|
@@ -360,11 +356,7 @@ if st.button("Generate Linear Interpolation"):
|
|
360 |
figure_2[0:28, i * 28:(i + 1) * 28, ] = generated_image[:, :, -1]
|
361 |
linear_predicted_interps.append(generated_image[:, :, -1])
|
362 |
|
363 |
-
|
364 |
-
# plt.imshow(figure, cmap='gray')
|
365 |
-
# plt.figure(2)
|
366 |
-
# st.pyplot(figure_2)
|
367 |
-
st.image(figure_2)
|
368 |
########################################################################################################################
|
369 |
# Provide User Options
|
370 |
st.header("Option 2: Perform a Mesh Interpolation")
|
@@ -436,4 +428,4 @@ if st.button("Generate Mesh Interpolation"):
|
|
436 |
figure_3[i * 28:(i + 1) * 28, j * 28:(j + 1) * 28, ] = generated_image[:, :, -1]
|
437 |
mesh_predicted_interps.append(generated_image[:, :, -1])
|
438 |
|
439 |
-
st.image(figure_3)
|
|
|
338 |
latent_dimensionality = len(latent_point_1) # define the dimensionality of the latent space
|
339 |
########################################################################################################################
|
340 |
# Establish the Framework for a LINEAR Interpolation
|
|
|
341 |
num_interp = int(interp_length) # the number of images to be pictured
|
342 |
latent_matrix = [] # This will contain the latent points of the interpolation
|
343 |
for column in range(latent_dimensionality):
|
|
|
347 |
########################################################################################################################
|
348 |
# Plotting the Interpolation in 2D Using Chosen Points
|
349 |
if st.button("Generate Linear Interpolation"):
|
|
|
|
|
350 |
linear_interp_latent = np.linspace(latent_point_1, latent_point_2, num_interp)
|
|
|
351 |
|
352 |
linear_predicted_interps = []
|
353 |
figure_2 = np.zeros((28, 28 * num_interp))
|
|
|
356 |
figure_2[0:28, i * 28:(i + 1) * 28, ] = generated_image[:, :, -1]
|
357 |
linear_predicted_interps.append(generated_image[:, :, -1])
|
358 |
|
359 |
+
st.image(figure_2, width=600)
|
|
|
|
|
|
|
|
|
360 |
########################################################################################################################
|
361 |
# Provide User Options
|
362 |
st.header("Option 2: Perform a Mesh Interpolation")
|
|
|
428 |
figure_3[i * 28:(i + 1) * 28, j * 28:(j + 1) * 28, ] = generated_image[:, :, -1]
|
429 |
mesh_predicted_interps.append(generated_image[:, :, -1])
|
430 |
|
431 |
+
st.image(figure_3, width=600)
|