kiwhansong commited on
Commit
55fc385
·
1 Parent(s): a71f061
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -260,9 +260,12 @@ def undo_navigation(
260
  video: torch.Tensor,
261
  poses: torch.Tensor,
262
  ):
263
- if len(video) >= 8:
264
  video = video[:-4]
265
  poses = poses[:-4]
 
 
 
266
  else:
267
  gr.Warning("You have no moves left to undo!")
268
  images = (video.permute(0, 2, 3, 1) * 255).clamp(0, 255).to(torch.uint8).numpy()
 
260
  video: torch.Tensor,
261
  poses: torch.Tensor,
262
  ):
263
+ if len(video) > 8:
264
  video = video[:-4]
265
  poses = poses[:-4]
266
+ elif len(video) == 8:
267
+ video = video[:1]
268
+ poses = poses[:1]
269
  else:
270
  gr.Warning("You have no moves left to undo!")
271
  images = (video.permute(0, 2, 3, 1) * 255).clamp(0, 255).to(torch.uint8).numpy()