SerdarHelli commited on
Commit
8721178
1 Parent(s): ff2c2a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -37,30 +37,30 @@ def layout_grid(img, grid_w=None, grid_h=1, float_to_uint8=True, chw_to_hwc=True
37
  network_pkl='braingan-400.pkl'
38
  with open(network_pkl, 'rb') as f:
39
  G = pickle.load(f)['G_ema']
40
-
 
 
 
41
  def predict(Seed,choices):
42
- device = torch.device('cuda')
43
- G.eval()
44
- G.to(device)
45
  shuffle_seed=None
46
  w_frames=60*4
47
  kind='cubic'
48
  num_keyframes=None
49
  wraps=2
50
  psi=1
51
- device=torch.device('cuda')
52
 
53
 
54
  if choices=='4x2':
55
  grid_w = 4
56
  grid_h = 2
57
  s1=Seed
58
- seeds=(np.arange(s1-16,s1)).tolist()
59
  if choices=='2x1':
60
  grid_w = 2
61
  grid_h = 1
62
  s1=Seed
63
- seeds=(np.arange(s1-4,s1)).tolist()
64
 
65
 
66
  mp4='ex.mp4'
 
37
  network_pkl='braingan-400.pkl'
38
  with open(network_pkl, 'rb') as f:
39
  G = pickle.load(f)['G_ema']
40
+
41
+ device = torch.device('cuda')
42
+ G.eval()
43
+ G.to(device)
44
  def predict(Seed,choices):
45
+
 
 
46
  shuffle_seed=None
47
  w_frames=60*4
48
  kind='cubic'
49
  num_keyframes=None
50
  wraps=2
51
  psi=1
 
52
 
53
 
54
  if choices=='4x2':
55
  grid_w = 4
56
  grid_h = 2
57
  s1=Seed
58
+ seeds=(np.arange(s1-8,s1)).tolist()
59
  if choices=='2x1':
60
  grid_w = 2
61
  grid_h = 1
62
  s1=Seed
63
+ seeds=(np.arange(s1-2,s1)).tolist()
64
 
65
 
66
  mp4='ex.mp4'