Toybrick

Could you let us know how to convert from YUV422 to YUV420 or RGB using NPU ?

nvnn

注册会员

积分
124
楼主
发表于 2020-3-30 18:12:31    查看: 7974|回复: 4 | [复制链接]    打印 | 只看该作者
Hi,
We are looking for a solution to feed YUV422 images to RKNN model. If we use Software solution to convert the image to RGB, it is very slow. Therefore, we are thinking of a solution of using NPU to convert the YUV422 image to RGB or YUV420. Could you please let us know if it is possible or not?
Alternatively, Could you let us know if it is possible to feed YUV422 images directly to RKNN model?

Thank you very much.
回复

使用道具 举报

jefferyzhang

版主

积分
13580
沙发
发表于 2020-3-30 20:50:10 | 只看该作者
本帖最后由 jefferyzhang 于 2020-3-30 20:51 编辑

Unsupported yet.
But you could reshape input from 4-channels to 3-channels or 1-channel and reshape to 4-channel in your model first layer.
And rknn config mean and std with '0 0 0 1'
回复

使用道具 举报

nvnn

注册会员

积分
124
板凳
 楼主| 发表于 2020-3-30 21:27:18 | 只看该作者
jefferyzhang 发表于 2020-3-30 20:50
Unsupported yet.
But you could reshape input from 4-channels to 3-channels or 1-channel and reshape  ...

Could you please elaborate more about this? what do you mean by reshape input from 4-channels to 3-channels or 1-channel? Does that mean I can feed YUV422 images directly to RKNN model (same accuracy as RGB)?
回复

使用道具 举报

jefferyzhang

版主

积分
13580
地板
发表于 2020-3-30 21:33:45 | 只看该作者
nvnn 发表于 2020-3-30 21:27
Could you please elaborate more about this? what do you mean by reshape input from 4-channels to 3 ...

More or less. For example, if you use tf.keras, input is yuyv422  100*100*2, you can design your net like:

model = keras.Sequential([
    keras.layers.Input(100*100*2),
    keras.layers.Reshape((100, 100, 2))
    ...
])

and feed model with flattened input.
回复

使用道具 举报

nvnn

注册会员

积分
124
5#
 楼主| 发表于 2020-3-31 09:05:22 | 只看该作者
jefferyzhang 发表于 2020-3-30 21:33
More or less. For example, if you use tf.keras, input is yuyv422  100*100*2, you can design your n ...

Thanks for your suggestion
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表