Skip to content

Industry leading face manipulation platform

3.4.2 (#975)

Henry Ruhs189d75062169
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 00000000..1da13b9f
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,2 @@
+[run]
+patch = subprocess
diff --git a/facefusion/audio.py b/facefusion/audio.py
index cb12ca93..739fc848 100644
--- a/facefusion/audio.py
+++ b/facefusion/audio.py
@@ -11,7 +11,7 @@ from facefusion.types import Audio, AudioFrame, Fps, Mel, MelFilterBank, Spectro
from facefusion.voice_extractor import batch_extract_voice
-@lru_cache()
+@lru_cache(maxsize = 64)
def read_static_audio(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
return read_audio(audio_path, fps)
@@ -31,7 +31,7 @@ def read_audio(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
return None
-@lru_cache()
+@lru_cache(maxsize = 64)
def read_static_voice(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
return read_voice(audio_path, fps)
diff --git a/facefusion/download.py b/facefusion/download.py
index 37179e8a..42458d0c 100644
--- a/facefusion/download.py
+++ b/facefusion/download.py
@@ -41,7 +41,7 @@ def conditional_download(download_directory_path : str, urls : List[str]) -> Non
progress.update(current_size - progress.n)
-@lru_cache(maxsize = 1024)
+@lru_cache(maxsize = 64)
def get_static_download_size(url : str) -> int:
commands = curl_builder.chain(
curl_builder.head(url),
@@ -59,7 +59,7 @@ def get_static_download_size(url : str) -> int:
return 0
-@lru_cache(maxsize = 1024)
+@lru_cache(maxsize = 64)
def ping_static_url(url : str) -> bool:
commands = curl_builder.chain(
curl_builder.head(url),
diff --git a/facefusion/face_analyser.py b/facefusion/face_analyser.py
index 855ebd7f..76b9b621 100644
--- a/facefusion/face_analyser.py
+++ b/facefusion/face_analyser.py
@@ -128,13 +128,7 @@ def scale_face(target_face : Face, target_vision_frame : VisionFrame, temp_visio
scale_x = temp_vision_frame.shape[1] / target_vision_frame.shape[1]
scale_y = temp_vision_frame.shape[0] / target_vision_frame.shape[0]
- bounding_box =\
- [
- target_face.bounding_box * scale_x,
- target_face.bounding_box * scale_y,
- target_face.bounding_box * scale_x,
- target_face.bounding_box * scale_y
- ]
+ bounding_box = target_face.bounding_box * [ scale_x, scale_y, scale_x, scale_y ]
landmark_set =\
{
'5': target_face.landmark_set.get('5') * numpy.array([ scale_x, scale_y ]),
diff --git a/facefusion/metadata.py b/facefusion/metadata.py
index 625746ac..2b2526b3 100644
--- a/facefusion/metadata.py
+++ b/facefusion/metadata.py
@@ -4,7 +4,7 @@ METADATA =\
{
'name': 'FaceFusion',
'description': 'Industry leading face manipulation platform',
- 'version': '3.4.1',
+ 'version': '3.4.2',
'license': 'OpenRAIL-AS',
'author': 'Henry Ruhs',
'url': 'https://facefusion.io'
diff --git a/facefusion/vision.py b/facefusion/vision.py
index 3166248b..fa06c729 100644
--- a/facefusion/vision.py
+++ b/facefusion/vision.py
@@ -22,7 +22,7 @@ def read_static_images(image_paths : List[str]) -> List[VisionFrame]:
return vision_frames
-@lru_cache(maxsize = 1024)
+@lru_cache(maxsize = 64)
def read_static_image(image_path : str) -> Optional[VisionFrame]:
return read_image(image_path)
@@ -65,7 +65,7 @@ def restrict_image_resolution(image_path : str, resolution : Resolution) -> Reso
return resolution
-@lru_cache(maxsize = 1024)
+@lru_cache(maxsize = 64)
def read_static_video_frame(video_path : str, frame_number : int = 0) -> Optional[VisionFrame]:
return read_video_frame(video_path, frame_number)