Compare commits

..

No commits in common. "cli" and "master" have entirely different histories.
cli ... master

17
main.py
View file

@ -424,7 +424,6 @@ def show_full_render(
target_silhouette, target_silhouette,
loss_history_color, loss_history_color,
loss_history_sil, loss_history_sil,
iteration
): ):
""" """
This is a helper function for visualizing the intermediate results of the This is a helper function for visualizing the intermediate results of the
@ -482,11 +481,10 @@ def show_full_render(
ax_.axis("off") ax_.axis("off")
ax_.set_title(title_) ax_.set_title(title_)
fig.canvas.draw() fig.canvas.draw()
fig.savefig(f"results/fullrender_{iteration:05d}.png") fig.show()
#fig.show() display.clear_output(wait=True)
#display.clear_output(wait=True) display.display(fig)
#display.display(fig) return fig
#return fig
############################################################################### ###############################################################################
@ -523,11 +521,11 @@ n_iter = 3000
loss_history_color, loss_history_sil = [], [] loss_history_color, loss_history_sil = [], []
# The main optimization loop. # The main optimization loop.
for iteration in tqdm(range(n_iter)): for iteration in range(n_iter):
# In case we reached the last 75% of iterations, # In case we reached the last 75% of iterations,
# decrease the learning rate of the optimizer 10-fold. # decrease the learning rate of the optimizer 10-fold.
if iteration == round(n_iter * 0.75): if iteration == round(n_iter * 0.75):
tqdm.write("Decreasing LR 10-fold ...") print("Decreasing LR 10-fold ...")
optimizer = torch.optim.Adam( optimizer = torch.optim.Adam(
neural_radiance_field.parameters(), lr=lr * 0.1 neural_radiance_field.parameters(), lr=lr * 0.1
) )
@ -597,7 +595,7 @@ for iteration in tqdm(range(n_iter)):
# Every 10 iterations, print the current values of the losses. # Every 10 iterations, print the current values of the losses.
if iteration % 10 == 0: if iteration % 10 == 0:
tqdm.write( print(
f"Iteration {iteration:05d}:" f"Iteration {iteration:05d}:"
+ f" loss color = {float(color_err):1.2e}" + f" loss color = {float(color_err):1.2e}"
+ f" loss silhouette = {float(sil_err):1.2e}" + f" loss silhouette = {float(sil_err):1.2e}"
@ -625,7 +623,6 @@ for iteration in tqdm(range(n_iter)):
target_silhouettes[show_idx][0], target_silhouettes[show_idx][0],
loss_history_color, loss_history_color,
loss_history_sil, loss_history_sil,
iteration,
) )
############################################################################### ###############################################################################