Kaushik066 commited on
Commit
dcdc92d
·
1 Parent(s): 46df290

Update app_swin.py

Browse files
Files changed (1) hide show
  1. app_swin.py +1 -1
app_swin.py CHANGED
@@ -272,7 +272,7 @@ def save_video_to_mp4(video_tensor, fps=10):
272
  video_numpy = video_tensor.permute(0, 2, 3, 1).cpu().numpy()
273
  # Normalize values to [0, 255] if necessary
274
  if video_numpy.max() <= 1.0:
275
- video_numpy = ((video_tensor + 1) / 2 * 255).astype(np.uint8) # Unnormalize
276
 
277
  # Create a temporary file to save the video
278
  temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".mp4")
 
272
  video_numpy = video_tensor.permute(0, 2, 3, 1).cpu().numpy()
273
  # Normalize values to [0, 255] if necessary
274
  if video_numpy.max() <= 1.0:
275
+ video_numpy = (((video_numpy + 1) / 2) * 255).astype(np.uint8) # Unnormalize
276
 
277
  # Create a temporary file to save the video
278
  temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".mp4")