Ejemplo n.º 1
0
 def score_row(self, args):
     num = args[0]
     full = args[1]
     edge = 100
     remains = self.panties.copy()
     if full:
         remains.pop(num)
     else:
         [remains.pop(0) for i in range(num + 1)]
     template_loader = image_loader(fdir=pantie_dir, queuesize=32)
     template_loader.flist = remains
     template_loader.start()
     scores = []
     ref = io.imread('./dream/%04d.png' % (num + 1))[50:-edge * 2, edge:-edge, :3]
     for check_pantie in remains:
         tmp = np.array(template_loader.read())[50:-edge * 2, edge:-edge, :3]
         scores.append(compare_mse(ref, tmp))
     return np.array(scores)
Ejemplo n.º 2
0
 def score_row(self, args):
     num = args[0]
     full = args[1]
     edge = 100
     remains = self.panties.copy()
     if full:
         remains.pop(num)
     else:
         [remains.pop(0) for i in range(num + 1)]
     template_loader = image_loader(fdir=pantie_dir, queuesize=32)
     template_loader.flist = remains
     template_loader.start()
     scores = []
     ref = io.imread(pantie_dir + panties[num])[50:-edge * 2,
                                                edge:-edge, :3]
     for check_pantie in remains:
         tmp = np.array(template_loader.read())[50:-edge * 2,
                                                edge:-edge, :3]
         scores.append(mean_squared_error(ref, tmp))
     if full:
         scores = np.insert(scores, num, 0)
     else:
         scores = np.pad(scores, (num + 1, 0), mode='constant')
     return np.array(scores)
Ejemplo n.º 3
0
print('Loading ' + args.model + ' patcher...')
module = importlib.import_module('models.' + args.model)

if args.input is not None:
    if args.json:
        patcher = module.patcher(body=args.input, options=options)
    else:
        patcher = module.patcher(body=args.input)
else:
    if args.json:
        patcher = module.patcher(options=options)
    else:
        patcher = module.patcher()

print('Starting pantie loader...')
pantie_loader = image_loader(fdir='./dream/')

if args.all:
    if args.directory == 'default':
        outdir = './converted/' + args.model
    else:
        outdir = './converted/' + args.directory
    os.makedirs(outdir, exist_ok=True)

    if args.pantie != 0:
        pantie_loader.flist = pantie_loader.flist[args.pantie - 1:]
    else:
        if args.force:
            pass
        else:
            pantie_loader.flist = pantie_loader.flist[len(os.listdir(outdir)):]