Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbds committed Nov 11, 2024
1 parent 0c397c1 commit f3c294d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,12 +1420,16 @@ def get_image_size(self, image_path):
image_size = imagesize.get(image_path)
if image_size[0] <= 0:
# imagesize doesn't work for some images, so use cv2
img = cv2.imread(image_path)
if img is not None:
image_size = (img.shape[1], img.shape[0])
else:
logger.warning(f"failed to get image size: {image_path}")
image_size = (0, 0)
# img = cv2.imread(image_path)
# if img is not None:
# image_size = (img.shape[1], img.shape[0])

with Image.open(image_path) as img:
if img is not None:
image_size = img.size
else:
logger.warning(f"failed to get image size: {image_path}")
image_size = (0, 0)
return image_size

def load_image_with_face_info(self, subset: BaseSubset, image_path: str, alpha_mask=False):
Expand Down
2 changes: 1 addition & 1 deletion requirements-uv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ h5py==3.11.0
# via
# keras
# tensorflow-intel
heavyball==0.9.0
heavyball==0.10.2
# via -r ./requirements.txt
huggingface-hub==0.24.5
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ prodigyopt
lion-pytorch
scipy
dadaptation
heavyball>=0.9.0
heavyball>=0.10.2
wandb==0.18.0
pillow-avif-plugin
schedulefree==1.3.0
Expand Down

0 comments on commit f3c294d

Please sign in to comment.