Fix -pairwise_y_binary
This commit is contained in:
parent
bb0fc3a1d3
commit
fe885a3466
|
@ -52,7 +52,12 @@ function pairwise_transform.user(x, y, size, offset, n, options)
|
||||||
xc:add(-mean)
|
xc:add(-mean)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(batch, {xc, iproc.crop(yc, offset, offset, size - offset, size - offset)})
|
yc = iproc.crop(yc, offset, offset, size - offset, size - offset)
|
||||||
|
if options.pairwise_y_binary then
|
||||||
|
yc[torch.lt(yc, 0.5)] = 0
|
||||||
|
yc[torch.gt(yc, 0)] = 1
|
||||||
|
end
|
||||||
|
table.insert(batch, {xc, yc})
|
||||||
end
|
end
|
||||||
|
|
||||||
return batch
|
return batch
|
||||||
|
|
|
@ -108,12 +108,6 @@ function pairwise_transform_utils.preprocess_user(x, y, scale_y, size, options)
|
||||||
|
|
||||||
x = iproc.crop_mod4(x)
|
x = iproc.crop_mod4(x)
|
||||||
y = iproc.crop_mod4(y)
|
y = iproc.crop_mod4(y)
|
||||||
|
|
||||||
if options.pairwise_y_binary then
|
|
||||||
y[torch.lt(y, 128)] = 0
|
|
||||||
y[torch.gt(y, 0)] = 255
|
|
||||||
end
|
|
||||||
|
|
||||||
return x, y
|
return x, y
|
||||||
end
|
end
|
||||||
function pairwise_transform_utils.active_cropping(x, y, lowres_y, size, scale, p, tries)
|
function pairwise_transform_utils.active_cropping(x, y, lowres_y, size, scale, p, tries)
|
||||||
|
|
Loading…
Reference in a new issue