From 0df6fd41ccdd3badf861af7f5612d669c7783960 Mon Sep 17 00:00:00 2001 From: nan jiang Date: Tue, 19 Sep 2023 11:01:56 +0800 Subject: [PATCH] Update inference.md video writer need a close() to prevent video length is not enough --- documentation/inference.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/inference.md b/documentation/inference.md index 413d720..6373c4b 100644 --- a/documentation/inference.md +++ b/documentation/inference.md @@ -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. \ No newline at end of file +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.