fbnnb commited on
Commit
eb8e058
Β·
verified Β·
1 Parent(s): 7e4ce8b

Update gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +8 -0
gradio_app.py CHANGED
@@ -132,6 +132,14 @@ def get_image(image1, prompt, image2, dim_steps=50, ddim_eta=1., fs=None, seed=1
132
  loop=False, interp=False, timestep_spacing='uniform', guidance_rescale=0.0, noise_shape=[72, 108], n_samples=1, **kwargs):
133
 
134
  seed_everything(seed)
 
 
 
 
 
 
 
 
135
  # image1 = Image.open(file_list[2*idx]).convert('RGB')
136
  image_tensor1 = transform(image1).unsqueeze(1) # [c,1,h,w]
137
  # image2 = Image.open(file_list[2*idx+1]).convert('RGB')
 
132
  loop=False, interp=False, timestep_spacing='uniform', guidance_rescale=0.0, noise_shape=[72, 108], n_samples=1, **kwargs):
133
 
134
  seed_everything(seed)
135
+
136
+ transform = transforms.Compose([
137
+ transforms.Resize(min(video_size)),
138
+ transforms.CenterCrop(video_size),
139
+ transforms.ToTensor(),
140
+ transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))]
141
+ )
142
+
143
  # image1 = Image.open(file_list[2*idx]).convert('RGB')
144
  image_tensor1 = transform(image1).unsqueeze(1) # [c,1,h,w]
145
  # image2 = Image.open(file_list[2*idx+1]).convert('RGB')