kex0 / batch-face-swap

Automaticaly detects faces and replaces them
338 stars 39 forks source link

Error running postprocess #73

Open thejohnd0e opened 1 year ago

thejohnd0e commented 1 year ago

Doesn't work now:

*** Error running postprocess: V:\stable-diffusion-portable-test\extensions\batch-face-swap\scripts\batch_face_swap.py
    Traceback (most recent call last):
      File "V:\stable-diffusion-portable-test\modules\scripts.py", line 498, in postprocess
        script.postprocess(p, processed, *script_args)
      File "V:\stable-diffusion-portable-test\extensions\batch-face-swap\scripts\batch_face_swap.py", line 1004, in postprocess
        finishedImages = generateImages(p, facecfg, input_image, input_path, searchSubdir, viewResults, int(divider), howSplit, saveMask, output_path, saveToOriginalFolder, onlyMask, saveNoFace, overridePrompt, bfs_prompt, bfs_nprompt, overrideSampler, sd_sampler, overrideModel, sd_model, overrideDenoising, denoising_strength, overrideMaskBlur, mask_blur, overridePadding, inpaint_full_res_padding, overrideSeed, overrideSteps, steps, overrideCfgScale, cfg_scale, overrideSize, bfs_width, bfs_height, invertMask, singleMaskPerImage, countFaces, maskWidth, maskHeight, keepOriginalName, pathExisting, pathMasksExisting, output_pathExisting, selectedTab, mainTab, loadGenParams, rotation_threshold)
      File "V:\stable-diffusion-portable-test\extensions\batch-face-swap\scripts\batch_face_swap.py", line 464, in generateImages
        masks, totalNumberOfFaces, faces_info, skip = findFaces(facecfg, image, width, height, divider, onlyHorizontal, onlyVertical, file, totalNumberOfFaces, singleMaskPerImage, countFaces, maskWidth, maskHeight, skip)
      File "V:\stable-diffusion-portable-test\extensions\batch-face-swap\scripts\batch_face_swap.py", line 93, in findFaces
        faceRects = getFaceRectanglesYuNet(small_image, known_face_rects)
      File "V:\stable-diffusion-portable-test\extensions\batch-face-swap\scripts\face_detect.py", line 311, in getFaceRectanglesYuNet
        _, faces = face_detector.detect(img_array)
    cv2.error: OpenCV(4.8.0) 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'
rchennault-exelixis commented 1 year ago

@thejohnd0e switch detector to a different value and it should work.