Hotfix release (#907)

* Revert to old-fashion face store

* Bump release

* Don't be evil

* Don't be evil
This commit is contained in:
Henry Ruhs
2025-07-07 20:21:39 +02:00
committed by GitHub
parent 26c701cd62
commit ac3504d03b
3 changed files with 12 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
import inspect
import itertools import itertools
import shutil import shutil
import signal import signal
@@ -6,7 +7,7 @@ from time import time
import numpy import numpy
from facefusion import benchmarker, cli_helper, content_analyser, face_classifier, face_detector, face_landmarker, face_masker, face_recognizer, logger, process_manager, state_manager, video_manager, voice_extractor, wording from facefusion import benchmarker, cli_helper, content_analyser, face_classifier, face_detector, face_landmarker, face_masker, face_recognizer, hash_helper, logger, process_manager, state_manager, video_manager, voice_extractor, wording
from facefusion.args import apply_args, collect_job_args, reduce_job_args, reduce_step_args from facefusion.args import apply_args, collect_job_args, reduce_job_args, reduce_step_args
from facefusion.common_helper import get_first from facefusion.common_helper import get_first
from facefusion.content_analyser import analyse_image, analyse_video from facefusion.content_analyser import analyse_image, analyse_video
@@ -126,7 +127,10 @@ def common_pre_check() -> bool:
voice_extractor voice_extractor
] ]
return all(module.pre_check() for module in common_modules) content_analyser_content = inspect.getsource(content_analyser).encode()
is_valid = hash_helper.create_hash(content_analyser_content) == 'b159fd9d'
return all(module.pre_check() for module in common_modules) and is_valid
def processors_pre_check() -> bool: def processors_pre_check() -> bool:

View File

@@ -15,16 +15,12 @@ def get_face_store() -> FaceStore:
def get_static_faces(vision_frame : VisionFrame) -> Optional[List[Face]]: def get_static_faces(vision_frame : VisionFrame) -> Optional[List[Face]]:
vision_area = crop_vision_area(vision_frame) vision_hash = create_hash(vision_frame.tobytes())
vision_hash = create_hash(vision_area.tobytes()) return FACE_STORE.get('static_faces').get(vision_hash)
if vision_hash in FACE_STORE['static_faces']:
return FACE_STORE['static_faces'][vision_hash]
return None
def set_static_faces(vision_frame : VisionFrame, faces : List[Face]) -> None: def set_static_faces(vision_frame : VisionFrame, faces : List[Face]) -> None:
vision_area = crop_vision_area(vision_frame) vision_hash = create_hash(vision_frame.tobytes())
vision_hash = create_hash(vision_area.tobytes())
if vision_hash: if vision_hash:
FACE_STORE['static_faces'][vision_hash] = faces FACE_STORE['static_faces'][vision_hash] = faces
@@ -34,23 +30,14 @@ def clear_static_faces() -> None:
def get_reference_faces() -> Optional[FaceSet]: def get_reference_faces() -> Optional[FaceSet]:
if FACE_STORE['reference_faces']: return FACE_STORE.get('reference_faces')
return FACE_STORE['reference_faces']
return None
def append_reference_face(name : str, face : Face) -> None: def append_reference_face(name : str, face : Face) -> None:
if name not in FACE_STORE['reference_faces']: if name not in FACE_STORE.get('reference_faces'):
FACE_STORE['reference_faces'][name] = [] FACE_STORE['reference_faces'][name] = []
FACE_STORE['reference_faces'][name].append(face) FACE_STORE['reference_faces'][name].append(face)
def clear_reference_faces() -> None: def clear_reference_faces() -> None:
FACE_STORE['reference_faces'].clear() FACE_STORE['reference_faces'].clear()
def crop_vision_area(vision_frame : VisionFrame) -> VisionFrame:
height, width = vision_frame.shape[:2]
center_y, center_x = height // 2, width // 2
vision_area = vision_frame[center_y - 16 : center_y + 16, center_x - 16 : center_x + 16]
return vision_area

View File

@@ -4,7 +4,7 @@ METADATA =\
{ {
'name': 'FaceFusion', 'name': 'FaceFusion',
'description': 'Industry leading face manipulation platform', 'description': 'Industry leading face manipulation platform',
'version': '3.3.0', 'version': '3.3.1',
'license': 'OpenRAIL-AS', 'license': 'OpenRAIL-AS',
'author': 'Henry Ruhs', 'author': 'Henry Ruhs',
'url': 'https://facefusion.io' 'url': 'https://facefusion.io'