简体   繁体   English

如何使用张量流预测图像中所有先前像素的下一个像素

[英]How to predict the next pixel given all previous pixels in an image using tensorflow

Just as a project, I wanted to see if it would be possible to predict the next pixel in an image given all previous pixels. 就像一个项目一样,我想看看是否有可能在给定所有先前像素的情况下预测图像中的下一个像素。
For example: lets say I have an image with x pixels. 例如:假设我有一个x像素的图像。 Given the first y pixels, I want to be able to somewhat accurately predict the y+1th pixel. 给定第一个y像素,我希望能够在某种程度上准确地预测第y + 1个像素。 How should I go about solving this problem. 我应该如何解决这个问题。

You are looking for some kind of generative model. 您正在寻找某种生成模型。 RNNs are commonly used, and there's a great blog post here demonstrating character-by-character text generation. RNN是常用的,这里有一篇很棒的博客文章展示了逐个字符的文本生成。

The same principle can be applied to any ordered sequence. 相同的原理可以应用于任何有序序列。 You talk about an image as being a sequence of pixels, but images have an intrinsic 2D structure (3 if you include color) that would be lost if you took the exact same approach as text generation. 您将图像称为像素序列,但是图像具有固有的2D结构(如果包含颜色,则为3),如果采用与生成文本完全相同的方法将会丢失。 A couple of ideas: 一些想法:

  1. Use tensorflow's GridLSTMCell s 使用tensorflow的GridLSTMCell
  2. Treat a column of pixels as a single element of the sequence and predict column-by-column (or row by row) 将一列像素视为序列的单个元素,并逐列(或逐行)预测
  3. Combine idea 2 with some 1D convolutions along the column/row 将想法2与沿列/行的一些一维卷积结合
  4. Use features from a section of an image as the seed to a generative adversarial network . 使用图像的一部分中的特征作为生成对抗网络的种子。 See this repository for basic implementations. 有关基本实现,请参见此存储库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 给定一个图像,一个像素点和一个以像素为单位的半径。 如何找到它创建的圆形边框的像素坐标 - Given a image, a pixel point and a radious in pixels. How do I find the pixel coordenate of the circle border it creates 获取光栅图像中所有像素的像素坐标 - get pixel coordinates of all pixels in a raster image Tensorflow LSTM:根据一系列先前的动作预测下一步动作 - Tensorflow LSTM: Predict next action based on a series of previous ones Numpy:如何找到给定像素一定距离内的所有像素并相应地加权? - Numpy: How to find all pixels within a certain distance of a given pixel and weigh them accordingly? Tensorflow-为图像张量中的每个像素找到最大的3个相邻像素 - Tensorflow - Finding biggest 3 neighbor pixels for each pixel in an image tensor 如何获取一个像素周围的所有 position 个像素 - how to get all the position of pixels around a pixel 在tensorflow中将所有0值图像像素转换为255 - Convert all 0 value image pixels to 255 in tensorflow 如何找到图像中所有皮肤像素的中值(R,G,B)像素值? - How to find the median (R,G,B) pixel value of all skin pixels in an image? 使用单个图像张量流进行预测,keras - Predict using a single image tensorflow , keras 如何在张量流中分配给图像中的像素? - How to assign to pixels in an image in eager tensorflow?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM