Fix lastframe

This commit is contained in:
hzwer
2020-11-15 23:08:08 +08:00
parent 540e762650
commit 5db0b9117f
2 changed files with 4 additions and 4 deletions

View File

@@ -48,9 +48,9 @@ if args.montage:
while success:
lastframe = frame
success, frame = videoCapture.read()
if args.montage:
frame = frame[:, left: left + w]
if success:
if args.montage:
frame = frame[:, left: left + w]if args.montage:
I0 = torch.from_numpy(np.transpose(lastframe, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0)
I1 = torch.from_numpy(np.transpose(frame, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0)
I0 = F.pad(I0, padding)

View File

@@ -48,9 +48,9 @@ if args.montage:
while success:
lastframe = frame
success, frame = videoCapture.read()
if args.montage:
frame = frame[:, left: left + w]
if success:
if args.montage:
frame = frame[:, left: left + w]
I0 = torch.from_numpy(np.transpose(lastframe, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0)
I1 = torch.from_numpy(np.transpose(frame, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0)
I0 = F.pad(I0, padding)