mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-14 00:53:48 -07:00
Sorter: improved sort by blur, and sort by best faces
This commit is contained in:
parent
669935c9e6
commit
29b1050637
2 changed files with 11 additions and 5 deletions
|
@ -269,9 +269,10 @@ def get_block_contrast(block):
|
|||
|
||||
|
||||
def estimate_sharpness(image):
|
||||
height, width = image.shape[:2]
|
||||
|
||||
if image.ndim == 3:
|
||||
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
if image.shape[2] > 1:
|
||||
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||||
else:
|
||||
image = image[...,0]
|
||||
|
||||
return compute(image)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue