1
0
Fork 0
mirror of synced 2024-05-16 10:52:20 +12:00

Add -invert_x option for user_method

This commit is contained in:
nagadomi 2017-05-17 08:51:07 +09:00
parent 05bc54fa12
commit cba96e36fb
2 changed files with 6 additions and 0 deletions

View file

@ -118,6 +118,10 @@ local function load_images(list)
-- method == user
local yy = im
local xx, meta2 = image_loader.load_byte(csv_meta.x)
if settings.invert_x then
xx = (-(xx:long()) + 255):byte()
end
if xx then
if meta2 and meta2.alpha then
xx = alpha_util.fill(xx, meta2.alpha, alpha_color)

View file

@ -80,6 +80,7 @@ cmd:option("-padding", 0, 'replication padding size')
cmd:option("-padding_y_zero", 0, 'zero padding y for segmentation (0|1)')
cmd:option("-grayscale", 0, 'grayscale x&y (0|1)')
cmd:option("-validation_filename_split", 0, 'make validation-set based on filename(basename)')
cmd:option("-invert_x", 0, 'invert x image in convert_lua')
local function to_bool(settings, name)
if settings[name] == 1 then
@ -101,6 +102,7 @@ to_bool(settings, "pairwise_flip")
to_bool(settings, "padding_y_zero")
to_bool(settings, "grayscale")
to_bool(settings, "validation_filename_split")
to_bool(settings, "invert_x")
if settings.plot then
require 'gnuplot'