Fix bug in handling of --train-jpeg parameter.
This commit is contained in:
+1
-1
@@ -180,7 +180,7 @@ class DataLoader(threading.Thread):
|
||||
seed = seed.filter(PIL.ImageFilter.GaussianBlur(radius=random.randint(0, args.train_blur*2)))
|
||||
if args.zoom > 1:
|
||||
seed = seed.resize((orig.size[0]//args.zoom, orig.size[1]//args.zoom), resample=PIL.Image.LANCZOS)
|
||||
if args.train_jpeg is not None:
|
||||
if len(args.train_jpeg) > 0:
|
||||
buffer, rng = io.BytesIO(), args.train_jpeg[-1] if len(args.train_jpeg) > 1 else 15
|
||||
seed.save(buffer, format='jpeg', quality=args.train_jpeg+random.randrange(-rng, +rng))
|
||||
seed = PIL.Image.open(buffer)
|
||||
|
||||
Reference in New Issue
Block a user