qt.QImage.fromTensor(tensor)
Return a new QImage
filled
with data from a torch Tensor
.
Tensor tensor
must have 2 or 3 dimensions.
- The first dimension defines the image width.
- The second dimension defines the image height.
- The third dimension size must be 1, 3, or 4
for monochrome, rgb, and rgba images respectively.
Each component is a floating point number in range 0 to 1.