Skip to content

Commit

Permalink
dev(narugo): fix c, ci skip
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Jun 1, 2024
1 parent 61980ac commit 8daefd4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions skpick/check/hqimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ def is_hqimage(file, face_threshold: int = 5000):
return True

image = load_image(image)
if anime_real(image)[0] != 'anime':
return False
if anime_classify(image)[0] != 'illustration':
try:
if anime_real(image)[0] != 'anime':
return False
if anime_classify(image)[0] != 'illustration':
return False

for (x0, y0, x1, y1), _, _ in detect_faces(image):
area = abs((x1 - x0) * (y1 - y0))
if area >= face_threshold:
return True
except OSError:
return False

for (x0, y0, x1, y1), _, _ in detect_faces(image):
area = abs((x1 - x0) * (y1 - y0))
if area >= face_threshold:
return True

return False

0 comments on commit 8daefd4

Please sign in to comment.