image - 从像素数组构建图像 - 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 输出的方法。
谢谢!
解决方案
推荐阅读
- c# - 如何遍历 Assets 文件夹中的子文件夹?
- android - 我们如何将三星银河皮肤添加到安卓模拟器中?
- javascript - 由nodeJS中的值总和产生的NaN
- android - Put & Delete 方法在 Retrofit 和 rxjava Android 中不起作用
- c# - 我需要从这个 JSON 中过滤所有的用户组
- java - 将 ObservableLists 用于 GUI 和后台任务的最佳方法是什么?
- shake-build-system - 如何使用shake-build为不同的环境构建?
- c - 有符号整数提升为无符号长整数
- javascript - 小部件的 ApostropheCMS 部署问题
- javascript - 有没有办法在 JS 中不断向屏幕添加移动对象?