Update inference.md

video writer need a close() to prevent video length is not enough
pull/251/head
nan jiang 1 year ago committed by GitHub
parent 53d74c6826
commit 0df6fd41cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -121,6 +121,7 @@ with torch.no_grad():
for src in DataLoader(reader):
fgr, pha, *rec = model(src.cuda(), *rec, downsample_ratio=0.25) # Cycle the recurrent states.
writer.write(fgr * pha + bgr * (1 - pha))
writer.close()
```
Or you can use the provided video converter:
@ -349,4 +350,4 @@ for src in YOUR_VIDEO: # src is PIL.Image.
```
Our CoreML models only support fixed resolutions. If you need other resolutions, you can export them yourself. See [coreml branch](https://github.com/PeterL1n/RobustVideoMatting/tree/coreml) for model export.
Our CoreML models only support fixed resolutions. If you need other resolutions, you can export them yourself. See [coreml branch](https://github.com/PeterL1n/RobustVideoMatting/tree/coreml) for model export.

Loading…
Cancel
Save