Skip to content

Commit

Permalink
Merge pull request kohya-ss#144 from tsukimiya/debug_dataset_linux_su…
Browse files Browse the repository at this point in the history
…pport

Fixed --debug_dataset option to work in non-Windows environments
  • Loading branch information
kohya-ss authored Feb 4, 2023
2 parents 44013fe + 949ee6f commit b1635f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,8 @@ def debug_dataset(train_dataset, show_input_ids=False):
im = ((im.numpy() + 1.0) * 127.5).astype(np.uint8)
im = np.transpose(im, (1, 2, 0)) # c,H,W -> H,W,c
im = im[:, :, ::-1] # RGB -> BGR (OpenCV)
cv2.imshow("img", im)
if os.name == 'nt': # only windows
cv2.imshow("img", im)
k = cv2.waitKey()
cv2.destroyAllWindows()
if k == 27:
Expand Down

0 comments on commit b1635f4

Please sign in to comment.