Skip to content

Commit

Permalink
sync local changes
Browse files Browse the repository at this point in the history
  • Loading branch information
katiezzzzz committed Sep 27, 2021
1 parent d08a982 commit e9b1426
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions cgan_earth/make_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,33 @@

# test1: forest, then transit to sea, then roll in sea
# the speed currently must start with the lowest possible speed to make sure the noise has right dimension
'''
# section s5_3
imgs1, noise, netG = roll_video(proj_path, desert_lbl, netG(z_dim+n_classes, img_length), n_classes, z_dim, lf, device, ratio, n_clips=int(8/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs1.shape)
imgs2, noise, netG = transit_video(desert_lbl, sea_lbl, n_classes, noise, netG, lf, ratio, device, step_size=0.25, z_step_size=0.33, l_step_size=0.25, transit_mode='scroll')
print(imgs2.shape)
imgs3, noise, netG = roll_video(proj_path, sea_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs3.shape)
imgs4, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='sub')
imgs4, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='sub')
print(imgs4.shape)
imgs5, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='add')
imgs5, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='add')
print(imgs5.shape)
imgs6, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='sub')
imgs6, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='sub')
print(imgs6.shape)
imgs7, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='add')
imgs7, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='add')
print(imgs7.shape)
imgs8, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='sub')
imgs8, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='sub')
print(imgs8.shape)
imgs9, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='add')
imgs9, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='add')
print(imgs9.shape)
imgs10, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='sub')
imgs10, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='sub')
print(imgs10.shape)
imgs11, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.015, method='add')
imgs11, noise, netG = change_noise(sea_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.025, method='add')
print(imgs11.shape)
imgs12, noise, netG = roll_video(proj_path, sea_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(16/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs12.shape)
'''

'''
# section s5_2
Expand All @@ -73,9 +75,9 @@
print(imgs2.shape)
imgs3, noise, netG = roll_video(proj_path, desert_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(36/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs3.shape)
imgs4, noise, netG = change_noise(desert_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(36/(1/0.25)), step_size=0.25, value=0.015, method='sub')
imgs4, noise, netG = change_noise(desert_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(36/(1/0.25)), step_size=0.25, value=0.025, method='sub')
print(imgs4.shape)
imgs5, noise, netG = change_noise(desert_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(36/(1/0.25)), step_size=0.25, value=0.015, method='add')
imgs5, noise, netG = change_noise(desert_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(36/(1/0.25)), step_size=0.25, value=0.025, method='add')
print(imgs5.shape)
'''

Expand All @@ -87,25 +89,25 @@
print(imgs2.shape)
imgs3, noise, netG = roll_video(proj_path, forest_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs3.shape)
imgs4, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs4, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs4.shape)
imgs5, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs5, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs5.shape)
imgs6, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs6, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs6.shape)
imgs7, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs7, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs7.shape)
imgs8, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs8, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs8.shape)
imgs9, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs9, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs9.shape)
imgs10, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(108/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs10, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(108/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs10.shape)
imgs11, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(108/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs11, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(108/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs11.shape)
imgs12, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs12, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs12.shape)
imgs13, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs13, noise, netG = change_noise(forest_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(104/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs13.shape)
'''

Expand Down Expand Up @@ -133,21 +135,21 @@
print(imgs10.shape)
imgs11, noise, netG = roll_video(proj_path, star_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs11.shape)
imgs12, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs12, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs12.shape)
imgs13, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs13, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs13.shape)
imgs14, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs14, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs14.shape)
imgs15, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs15, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs15.shape)
imgs16, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs16, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs16.shape)
imgs17, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs17, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs17.shape)
imgs18, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='sub')
imgs18, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='sub')
print(imgs18.shape)
imgs19, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.01, method='add')
imgs19, noise, netG = change_noise(star_lbl, noise, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(72/(1/0.25)), step_size=0.25, value=0.02, method='add')
print(imgs19.shape)
'''

Expand Down Expand Up @@ -182,7 +184,7 @@
print(imgs13.shape)
'''

'''

# section s2
imgs1, noise, netG = roll_video(proj_path, forest_lbl, netG(z_dim+n_classes, img_length), n_classes, z_dim, lf, device, ratio, n_clips=int(5/(1/0.2)), step_size=0.2, original_noise=noise)
print(imgs1.shape)
Expand Down Expand Up @@ -215,7 +217,7 @@
print(imgs14.shape)
imgs15, noise, netG = roll_video(proj_path, sea_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=101, step_size=2, original_noise=noise)
print(imgs15.shape)
'''


'''
# section s1
Expand All @@ -237,7 +239,7 @@
print(imgs7.shape)
imgs8, noise, netG = transit_video(desert_lbl, forest_lbl, n_classes, noise, netG, lf, ratio, device, step_size=0.5, z_step_size=0.33, l_step_size=0.33, transit_mode='circular')
print(imgs8.shape)
imgs9, noise, netG = roll_video(proj_path, forest_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(740/(1/0.5)), step_size=0.5, original_noise=noise)
imgs9, noise, netG = roll_video(proj_path, forest_lbl, netG, n_classes, z_dim, lf, device, ratio, n_clips=int(740/(1/0.25)), step_size=0.25, original_noise=noise)
print(imgs9.shape)
'''

Expand All @@ -253,9 +255,9 @@
imgs = np.vstack((imgs, imgs10))
imgs = np.vstack((imgs, imgs11))
imgs = np.vstack((imgs, imgs12))
#imgs = np.vstack((imgs, imgs13))
#imgs = np.vstack((imgs, imgs14))
#imgs = np.vstack((imgs, imgs15))
imgs = np.vstack((imgs, imgs13))
imgs = np.vstack((imgs, imgs14))
imgs = np.vstack((imgs, imgs15))
#imgs = np.vstack((imgs, imgs16))
#imgs = np.vstack((imgs, imgs17))
#imgs = np.vstack((imgs, imgs18))
Expand Down

0 comments on commit e9b1426

Please sign in to comment.