BabitMF / bmf

Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.
https://babitmf.github.io/
Apache License 2.0
773 stars 65 forks source link

使用torch.from_dlpack(vf.reformat(rgb).frame().plane(0))方法,会增加很多显存 #116

Open zhangsong1234 opened 4 months ago

zhangsong1234 commented 4 months ago

人脸检测模型中使用torch.from_dlpack(vf.reformat(rgb).frame().plane(0))方法后显存明显增加了很多,输入是4K图片,使用与不使用这个方法显存差了500M左右

sfeiwong commented 4 months ago

为了把数据给到torch,dlpack应该会额外占用一些显存做copy。

zhangsong1234 commented 4 months ago

4K图片一张只有24M,但使用这个方法时增加了500M