mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-05 20:03:03 +00:00
fix Auto focal point crop for opencv >= 4.8.x
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
This commit is contained in:
@@ -3,7 +3,7 @@ from PIL import Image, ImageOps
|
||||
import math
|
||||
import tqdm
|
||||
|
||||
from modules import paths, shared, images, deepbooru
|
||||
from modules import shared, images, deepbooru
|
||||
from modules.textual_inversion import autocrop
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ def preprocess_work(process_src, process_dst, process_width, process_height, pre
|
||||
|
||||
dnn_model_path = None
|
||||
try:
|
||||
dnn_model_path = autocrop.download_and_cache_models(os.path.join(paths.models_path, "opencv"))
|
||||
dnn_model_path = autocrop.download_and_cache_models()
|
||||
except Exception as e:
|
||||
print("Unable to load face detection model for auto crop selection. Falling back to lower quality haar method.", e)
|
||||
|
||||
|
Reference in New Issue
Block a user