首页 > 解决方案 > 从像素数组构建图像 - Flutter

问题描述

Tensorflow-Lite 的 Pix2Pix 实现输出一个 Uint8List:

Uint8List input;
var output = await Tflite.runPix2PixOnBinary(binary: input, asynch: true);

结果现在已转换为 Image 对象以显示它。这就是问题。

图片似乎具有某种标头或签名,这对于Image 包的decodeImage()函数 或类似的解码函数(MemoryImage、Image.memory、decodeImageFromList)是必不可少的。

这个答案提供了一个解决方案,不幸的是它只适用于 256 种不同的颜色(一个通道?)。TfLite 输出 x 个通道...

我正在寻找类似 Python Pillow Package 及其功能的东西

new_image = Image.fromarray(array)

或其他显示 Pix2Pix 输出的方法。

谢谢!

标签: imageflutterdartdecodetensorflow-lite

解决方案


推荐阅读