1 加载pytorch训练的模型(.pt)
2 读取与pt模型中一致(c,w,h)的input图像
3 如果input是彩色图像,那么需要保证其通道顺序r,g,b,其值归一化处理。
4 model->forward
5 取得结果tensor,映射到0-255, tensor.data_ptr()为指向数据指针,遍历可取。
1 加载pytorch训练的模型(.pt)
2 读取与pt模型中一致(c,w,h)的input图像
3 如果input是彩色图像,那么需要保证其通道顺序r,g,b,其值归一化处理。
4 model->forward
5 取得结果tensor,映射到0-255, tensor.data_ptr()为指向数据指针,遍历可取。
1571

被折叠的 条评论
为什么被折叠?
