FIX: List index out of range when no face found
Face Model Error, Issue #214
This commit is contained in:
parent
70479479b3
commit
d11a8a6941
@ -2,7 +2,7 @@
|
||||
|
||||
<img src="https://github.com/Gourieff/Assets/raw/main/sd-webui-reactor/ReActor_logo_red.png?raw=true" alt="logo" width="180px"/>
|
||||
|
||||

|
||||

|
||||
|
||||
<a href='https://ko-fi.com/gourieff' target='_blank'><img height='33' src='https://storage.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<img src="https://github.com/Gourieff/Assets/raw/main/sd-webui-reactor/ReActor_logo_red.png?raw=true" alt="logo" width="180px"/>
|
||||
|
||||

|
||||

|
||||
|
||||
<a href='https://ko-fi.com/gourieff' target='_blank'><img height='33' src='https://storage.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||
|
||||
|
||||
@ -533,10 +533,10 @@ def build_face_model(image: Image.Image, name: str):
|
||||
apply_logging_patch(1)
|
||||
image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
|
||||
logger.status("Building Face Model...")
|
||||
face_model = analyze_faces(image)[0]
|
||||
if face_model is not None:
|
||||
face_model = analyze_faces(image)
|
||||
if face_model is not None and len(face_model) > 0:
|
||||
face_model_path = os.path.join(FACE_MODELS_PATH, name + ".safetensors")
|
||||
save_face_model(face_model,face_model_path)
|
||||
save_face_model(face_model[0],face_model_path)
|
||||
logger.status("--Done!--")
|
||||
done_msg = f"Face model has been saved to '{face_model_path}'"
|
||||
logger.status(done_msg)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
app_title = "ReActor"
|
||||
version_flag = "v0.5.1-b3"
|
||||
version_flag = "v0.5.1-b4"
|
||||
|
||||
from scripts.reactor_logger import logger, get_Run, set_Run
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user