cmdbug / TNN_Demo

🍉 移动端TNN部署学习笔记,支持Android与iOS。
GNU General Public License v3.0
71 stars 18 forks source link

input_cvt_param.scale and bias #17

Closed henbucuoshanghai closed 2 years ago

henbucuoshanghai commented 2 years ago

input_cvt_param.scale = {1.0 / 255, 1.0 / 255, 1.0 / 255, 0.0}; input_cvt_param.bias = {0.0, 0.0, 0.0, 0.0}; why scale is 1/255 ,and the last is 0.0? bias is ?

cmdbug commented 2 years ago

tnn input : scale * input + bias If I remember correctly, the fourth is alpha You need to view how the corresponding training model handles the input during training

henbucuoshanghai commented 2 years ago

tks I know scale * input + bias. the fourth is alpha?means?

henbucuoshanghai commented 2 years ago

when my input is five dims,I need five bias and scales??

cmdbug commented 2 years ago

rgba

henbucuoshanghai commented 2 years ago

我的数据不是图片,是自定义数组,五维的。 数组已经确认过没问题,py版本直接测试即可,但是传入tnn后,结果不对,请问scale和bias怎么设置呢

cmdbug commented 2 years ago

该项目示例适合使用以下步骤: https://github.com/cmdbug/TNN_Demo/issues/1 其它方式需要自己改写后处理。 scale/bias是与你训练模型的输入有关。比如你训练模型输入是0-1的值,那么你在tnn的转换后的输入也应该是0-1。

henbucuoshanghai commented 2 years ago

热心的回复,项目跑通了,厉害的项目。感谢! 模型输入是01之间,已经统统处理好了,存为数组;现在数组传进tnn,bias是1,scale是0?但是结果不对。。请问熟悉吗?

cmdbug commented 2 years ago

如果已经处理了,那也应该是 scale 是 1,bias 是 0

cmdbug commented 2 years ago

该项目是 4 维输入,请认真看 https://github.com/cmdbug/TNN_Demo/issues/1 说明过程,否则请自行改本项目的后处理。

henbucuoshanghai commented 2 years ago

tks 热心的回复

henbucuoshanghai commented 2 years ago

你好 回复rgba 是什么意思呢? 自己的数据必须unsigned 变成数组 传进tnn?

cmdbug commented 2 years ago

input_cvt_param.scale = {1.0 / 255, 1.0 / 255, 1.0 / 255, 0.0}; input_cvt_param.bias = {0.0, 0.0, 0.0, 0.0}; 4个参数是 rgba

henbucuoshanghai commented 2 years ago

明白明白   多谢, 那输入不是图像,五维的,怎么办呢?,试了很多bias,scale,结果总是对不上。。不知道怎么回事

cmdbug commented 2 years ago

我输入都是rgba的4维图像,不是图像还是5维的就不懂了,建议去tnn问。

henbucuoshanghai commented 2 years ago

多谢多谢明白,我去官方问问。感激!