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

Error in image preprocessing. Auto focal point crop is not work. #50

Closed
724791ce opened this issue Oct 16, 2023 · 2 comments
Closed

Error in image preprocessing. Auto focal point crop is not work. #50

724791ce opened this issue Oct 16, 2023 · 2 comments

Comments

@724791ce
Copy link

724791ce commented Oct 16, 2023

The following error statement appears and the task crashes when auto-crap is applied.
All works well if auto crop is disabled.


 Train Tools: dataset update error OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:279: error: (-204:Requested object was not found) Layer with requested id=-1 not found in function 'cv::dnn::dnn4_v20230620::Net::Impl::getLayerData'
Traceback (most recent call last)
  File "C:\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\dateset_ui.py", line 107, in on_ui_update_dataset_click
    preprocess.preprocess(None, origin_preload_data_path, processed_output_path,
  File "C:\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\tools\preprocess.py", line 22, in preprocess
    preprocess_work(process_src, process_dst, process_width, process_height, preprocess_txt_action, process_keep_original_size, process_flip, process_split, process_caption, process_caption_deepbooru, split_threshold, overlap_ratio, process_focal_crop, process_focal_crop_face_weight, process_focal_crop_entropy_weight, process_focal_crop_edges_weight, process_focal_crop_debug, process_multicrop, process_multicrop_mindim, process_multicrop_maxdim, process_multicrop_minarea, process_multicrop_maxarea, process_multicrop_objective, process_multicrop_threshold)
  File "C:\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\tools\preprocess.py", line 216, in preprocess_work
    for focal in autocrop.crop_image(img, autocrop_settings):
  File "C:\stable-diffusion-webui\modules\textual_inversion\autocrop.py", line 33, in crop_image
    focus = focal_point(im_debug, settings)
  File "C:\stable-diffusion-webui\modules\textual_inversion\autocrop.py", line 76, in focal_point
    face_points = image_face_points(im, settings) if settings.face_points_weight > 0 else []
  File "C:\stable-diffusion-webui\modules\textual_inversion\autocrop.py", line 151, in image_face_points
    faces = detector.detect(np.array(im))
cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:279: error: (-204:Requested object was not found) Layer with requested id=-1 not found in function 'cv::dnn::dnn4_v20230620::Net::Impl::getLayerData'

I found the following interesting statement regarding this issue.
AUTOMATIC1111/stable-diffusion-webui#11727
This is the same problem as the above page, and I wonder if this is due to the open cv version upgrade (4.7 series→4.8 series) that came with the control net update.
I have a log of open cv 4.8 in my PC that was upgraded on the day the problem occurred.
But i dont know how to downgrade.

@liasece
Copy link
Owner

liasece commented Oct 17, 2023

AUTOMATIC1111/stable-diffusion-webui#11727 (comment) worked?

@724791ce
Copy link
Author

I did it.
I tried the link procedure.
Downgrading opencv from 4.8 to 4.7.0.72 in the venv used in webui. After that, everything worked out fine.
Now that the issue is resolved, I'll close this place.

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

No branches or pull requests

2 participants