RVM-Inference
RVM-Inference copied to clipboard
使用固定的downsample模型跑的时候,人物上蒙上一层绿点是什么情况?
是我的推理代码有问题吗?
你的rxi没有根据最新帧推理的结果更新啊,每次都是随机的值,而且一开始不应该是随机初始化,而是初始化为0. 可以参考我写的一个动态onnx推理的python版本,在我fork的分支里的inference_onnx.py:
- https://github.com/DefTruth/RobustVideoMatting/blob/onnx/inference_onnx.py
以及我在RVM里的PR:
- https://github.com/PeterL1n/RobustVideoMatting/pull/27
补充一下,你这里的数据预处理需要和RVM的源码一致。它的预处理是:
transform = transforms.Compose([
transforms.Resize(input_resize[::-1]),
transforms.ToTensor()
])
transforms.ToTensor()里面做了归一化,x=x/255.