Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto focal point crop for opencv >= 4.8 #14121

Merged
merged 2 commits into from
Dec 2, 2023

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Nov 27, 2023

Description

#14118 [Bug]: auto focal point crop only work under opencv-python<4.8
#11727 [Bug]: Preprocess images in the "Train" tab crashes when "Auto Focal Point Crop" is selected

face detection model was updated in opencv 4.8+
face_detection_yunet_2022mar -> face_detection_yunet_2023mar
opencv/opencv_zoo@f12e127

this PR
if opencv >= 4.8 downlaod the 2023 ver else 2022 ver
the 2023 version will use the filename face_detection_yunet_2023mar.onnx
where the 2022 version use the same filename as before face_detection_yunet.onnx to avoid redownload


for unknow reason autocrop.py used a mix of indent 2 and 4, I performed a re-format of the file

autocrop.download_and_cache_models
in opencv >= 4.8 the face detection model was updated
download the base on opencv version
returns the model path or raise exception
@w-e-w w-e-w force-pushed the fix-Auto-focal-point-crop-for-opencv-4.8.x branch from 3e735ef to d608926 Compare November 28, 2023 03:16
@AUTOMATIC1111 AUTOMATIC1111 merged commit 9eadc4f into dev Dec 2, 2023
6 checks passed
@AUTOMATIC1111 AUTOMATIC1111 deleted the fix-Auto-focal-point-crop-for-opencv-4.8.x branch December 2, 2023 06:46
@w-e-w w-e-w mentioned this pull request Dec 4, 2023
@w-e-w w-e-w mentioned this pull request Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: auto focal point crop only work under opencv-python<4.8
2 participants