blob: c3cdbf4405b5a45b15255486a389be2bf7762276 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
require 'qt'
require 'torch'
require 'libqttorch'
qt.QImage.fromTensor = function(tensor, scale)
return tensor.qttorch.QImageFromTensor(tensor, scale)
end
qt.QImage.toTensor = function(self, tensor, scale, depth)
if type(tensor) == 'userdata' then
return tensor.qttorch.QImageToTensor(self, tensor, scale, depth)
else
local t = torch.getmetatable(torch.getdefaulttensortype())
return t.qttorch.QImageToTensor(self, tensor, scale, depth)
end
end
|