Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 559e66b

Browse files
committed
Fix exception when training with JPEG compression.
1 parent 9d2aa3c commit 559e66b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

enhance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def add_to_buffer(self, f):
182182
seed = seed.resize((orig.size[0]//args.zoom, orig.size[1]//args.zoom), resample=PIL.Image.LANCZOS)
183183
if len(args.train_jpeg) > 0:
184184
buffer, rng = io.BytesIO(), args.train_jpeg[-1] if len(args.train_jpeg) > 1 else 15
185-
seed.save(buffer, format='jpeg', quality=args.train_jpeg+random.randrange(-rng, +rng))
185+
seed.save(buffer, format='jpeg', quality=args.train_jpeg[0]+random.randrange(-rng, +rng))
186186
seed = PIL.Image.open(buffer)
187187

188188
orig = scipy.misc.fromimage(orig).astype(np.float32)

0 commit comments

Comments
 (0)