da03 commited on
Commit
f660fd9
·
1 Parent(s): fd3598c
Files changed (2) hide show
  1. main.py +2 -0
  2. utils.py +2 -2
main.py CHANGED
@@ -135,6 +135,8 @@ def draw_trace(image: np.ndarray, previous_actions: List[Tuple[str, List[int]]],
135
  y_current = y_current *8
136
  print ('x_current, y_current', x_current, y_current)
137
  draw.ellipse([x_current-3, y_current-3, x_current+3, y_current+3], fill=(0, 255, 0))
 
 
138
 
139
  return np.array(pil_image)
140
 
 
135
  y_current = y_current *8
136
  print ('x_current, y_current', x_current, y_current)
137
  draw.ellipse([x_current-3, y_current-3, x_current+3, y_current+3], fill=(0, 255, 0))
138
+ else:
139
+ assert False
140
 
141
  return np.array(pil_image)
142
 
utils.py CHANGED
@@ -77,8 +77,8 @@ def sample_frame(model: LatentDiffusion, prompt: str, image_sequence: torch.Tens
77
  if DEBUG:
78
  print ('samples_ddim.shape', samples_ddim.shape)
79
  x_samples_ddim = samples_ddim[:, :3]
80
- # upsample to 512 x 368
81
- x_samples_ddim = torch.nn.functional.interpolate(x_samples_ddim, size=(512, 368), mode='bilinear')
82
  else:
83
  x_samples_ddim = model.decode_first_stage(samples_ddim)
84
  #x_samples_ddim = pos_map.to(c['c_concat'].device).unsqueeze(0).expand(-1, 3, -1, -1)
 
77
  if DEBUG:
78
  print ('samples_ddim.shape', samples_ddim.shape)
79
  x_samples_ddim = samples_ddim[:, :3]
80
+ # upsample to 512 x 384
81
+ x_samples_ddim = torch.nn.functional.interpolate(x_samples_ddim, size=(384, 512), mode='bilinear')
82
  else:
83
  x_samples_ddim = model.decode_first_stage(samples_ddim)
84
  #x_samples_ddim = pos_map.to(c['c_concat'].device).unsqueeze(0).expand(-1, 3, -1, -1)