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 two bugs that will cause the plugin to be completely unusable #88

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/batch_face_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def findFaces(facecfg, image, width, height, divider, onlyHorizontal, onlyVertic
new_image.paste(processed_image, (x, y))
masks.append(new_image)

if countFaces:
return totalNumberOfFaces
# if countFaces:
# return totalNumberOfFaces

if file != None:
if FaceDetectDevelopment:
Expand Down Expand Up @@ -1027,4 +1027,4 @@ def postprocess(self, p, processed, enabled, mainTab, overridePrompt, bfs_prompt
# "", "Default Negative Prompt", section=section))


# script_callbacks.on_ui_settings(on_ui_settings)
# script_callbacks.on_ui_settings(on_ui_settings)
2 changes: 1 addition & 1 deletion scripts/face_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def getFaceRectangles(image, known_face_rects, facecfg):

def getFaceRectanglesYuNet(img_array, known_face_rects):
new_faces = []
dnn_model_path = autocrop.download_and_cache_models(os.path.join(models_path, "opencv"))
dnn_model_path = autocrop.download_and_cache_models()
face_detector = cv2.FaceDetectorYN.create(dnn_model_path, "", (0, 0))

face_detector.setInputSize((img_array.shape[1], img_array.shape[0]))
Expand Down