3.4.2 (#975)
* Reduce caching to avoid RAM explosion * Reduce caching to avoid RAM explosion * Reduce caching to avoid RAM explosion * fix bounding_box scale * Bump to 3.4.2 * More conservative on audio caching * Fix coverage issue * Fix coverage issue --------- Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com>
This commit is contained in:
2
.coveragerc
Normal file
2
.coveragerc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[run]
|
||||||
|
patch = subprocess
|
||||||
@@ -11,7 +11,7 @@ from facefusion.types import Audio, AudioFrame, Fps, Mel, MelFilterBank, Spectro
|
|||||||
from facefusion.voice_extractor import batch_extract_voice
|
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]]:
|
def read_static_audio(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
|
||||||
return read_audio(audio_path, fps)
|
return read_audio(audio_path, fps)
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ def read_audio(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@lru_cache()
|
@lru_cache(maxsize = 64)
|
||||||
def read_static_voice(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
|
def read_static_voice(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]:
|
||||||
return read_voice(audio_path, fps)
|
return read_voice(audio_path, fps)
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ def conditional_download(download_directory_path : str, urls : List[str]) -> Non
|
|||||||
progress.update(current_size - progress.n)
|
progress.update(current_size - progress.n)
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize = 1024)
|
@lru_cache(maxsize = 64)
|
||||||
def get_static_download_size(url : str) -> int:
|
def get_static_download_size(url : str) -> int:
|
||||||
commands = curl_builder.chain(
|
commands = curl_builder.chain(
|
||||||
curl_builder.head(url),
|
curl_builder.head(url),
|
||||||
@@ -59,7 +59,7 @@ def get_static_download_size(url : str) -> int:
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize = 1024)
|
@lru_cache(maxsize = 64)
|
||||||
def ping_static_url(url : str) -> bool:
|
def ping_static_url(url : str) -> bool:
|
||||||
commands = curl_builder.chain(
|
commands = curl_builder.chain(
|
||||||
curl_builder.head(url),
|
curl_builder.head(url),
|
||||||
|
|||||||
@@ -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_x = temp_vision_frame.shape[1] / target_vision_frame.shape[1]
|
||||||
scale_y = temp_vision_frame.shape[0] / target_vision_frame.shape[0]
|
scale_y = temp_vision_frame.shape[0] / target_vision_frame.shape[0]
|
||||||
|
|
||||||
bounding_box =\
|
bounding_box = target_face.bounding_box * [ scale_x, scale_y, scale_x, scale_y ]
|
||||||
[
|
|
||||||
target_face.bounding_box * scale_x,
|
|
||||||
target_face.bounding_box * scale_y,
|
|
||||||
target_face.bounding_box * scale_x,
|
|
||||||
target_face.bounding_box * scale_y
|
|
||||||
]
|
|
||||||
landmark_set =\
|
landmark_set =\
|
||||||
{
|
{
|
||||||
'5': target_face.landmark_set.get('5') * numpy.array([ scale_x, scale_y ]),
|
'5': target_face.landmark_set.get('5') * numpy.array([ scale_x, scale_y ]),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ METADATA =\
|
|||||||
{
|
{
|
||||||
'name': 'FaceFusion',
|
'name': 'FaceFusion',
|
||||||
'description': 'Industry leading face manipulation platform',
|
'description': 'Industry leading face manipulation platform',
|
||||||
'version': '3.4.1',
|
'version': '3.4.2',
|
||||||
'license': 'OpenRAIL-AS',
|
'license': 'OpenRAIL-AS',
|
||||||
'author': 'Henry Ruhs',
|
'author': 'Henry Ruhs',
|
||||||
'url': 'https://facefusion.io'
|
'url': 'https://facefusion.io'
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ def read_static_images(image_paths : List[str]) -> List[VisionFrame]:
|
|||||||
return vision_frames
|
return vision_frames
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize = 1024)
|
@lru_cache(maxsize = 64)
|
||||||
def read_static_image(image_path : str) -> Optional[VisionFrame]:
|
def read_static_image(image_path : str) -> Optional[VisionFrame]:
|
||||||
return read_image(image_path)
|
return read_image(image_path)
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ def restrict_image_resolution(image_path : str, resolution : Resolution) -> Reso
|
|||||||
return resolution
|
return resolution
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize = 1024)
|
@lru_cache(maxsize = 64)
|
||||||
def read_static_video_frame(video_path : str, frame_number : int = 0) -> Optional[VisionFrame]:
|
def read_static_video_frame(video_path : str, frame_number : int = 0) -> Optional[VisionFrame]:
|
||||||
return read_video_frame(video_path, frame_number)
|
return read_video_frame(video_path, frame_number)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user