Пример #1
0
def createExitModel(ModelName, gray=True, preprocessFunc=lambda x: x):
    FeatureName = "Wyjscie"
    TrainModeName = FeatureName + ModelName
    image_size_level = 5
    base_scale = 1.0

    cols, rows = moil.getColsRows(level=image_size_level,
                                  base_scale=base_scale)

    if (gray):
        mode = 0
        channels_in = 1
        color_mode = 'grayscale'
    else:
        mode = 1
        channels_in = 3
        color_mode = 'rgb'
    filters = 8
    weights_path = "../../weights/unet" + TrainModeName
    var_filename = "../../weights/var" + TrainModeName + ".txt"
    Mod = md.Models(rows,
                    cols,
                    mode=mode,
                    channels=channels_in,
                    weights_path=weights_path,
                    var_filename=var_filename,
                    read_func=moil.read_and_size,
                    preprocessFunc=preprocessFunc)
    Mod.get_model(filters=filters)
    Mod.load_weights()

    return Mod
Пример #2
0
    def __init__(self, image_path, winname, size_level, scale):
        self.image_path = image_path
        self.winname = winname
        self.accepted = True
        self.masks_done = 0
        self.mask = None
        self.rr = 0
        self.xx = 0
        self.yy = 0

        self.targetSize = moil.getColsRows(size_level, scale)
Пример #3
0
 def __init__(self,
              repo_base,
              repo_name,
              new_name,
              size_level,
              scale=0.75,
              function=lambda x: x,
              onlyMasked=True,
              override=True):
     self.old_repo = repo_base + repo_name + '/'
     self.new_repo = repo_base + new_name + '/'
     self.target_size = moil.getColsRows(size_level, scale)
     self.onlyMasked = onlyMasked
     self.override = override
     self.function = function
Пример #4
0
base_path = '../'
image_size_level = 20
base_scale = 0.75
withMetricOrNo = 1
onlyWithMetric = False
onlyWithoutMetric = False
if withMetricOrNo == 1:
    onlyWithMetric = True
if withMetricOrNo == 2:
    onlyWithoutMetric = True
batch_size = 32
total_ep = 1
ep = 500
steps = 10

cols, rows = moil.getColsRows(level=image_size_level, base_scale=base_scale)
gray = True

if (gray):
    mode = 0
    channels_in = 1
    color_mode = 'grayscale'
else:
    mode = 1
    channels_in = 3
    color_mode = 'rgb'

# data augmentation
aug = dac.getAugmentationParams()

FeatureName = "Tarcza"