diff --git a/facefusion/audio.py b/facefusion/audio.py index 383e225..bf5418a 100644 --- a/facefusion/audio.py +++ b/facefusion/audio.py @@ -11,7 +11,7 @@ from facefusion.typing import Audio, AudioFrame, Fps, Mel, MelFilterBank, Spectr from facefusion.voice_extractor import batch_extract_voice -@lru_cache(maxsize = 128) +@lru_cache() 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(maxsize = 128) +@lru_cache() def read_static_voice(audio_path : str, fps : Fps) -> Optional[List[AudioFrame]]: return read_voice(audio_path, fps) diff --git a/facefusion/hash_helper.py b/facefusion/hash_helper.py index f326ecf..5259edb 100644 --- a/facefusion/hash_helper.py +++ b/facefusion/hash_helper.py @@ -13,7 +13,7 @@ def validate_hash(validate_path : str) -> bool: hash_path = get_hash_path(validate_path) if is_file(hash_path): - with open(hash_path, 'r') as hash_file: + with open(hash_path) as hash_file: hash_content = hash_file.read().strip() with open(validate_path, 'rb') as validate_file: diff --git a/facefusion/json.py b/facefusion/json.py index dcb182c..e1ba2ae 100644 --- a/facefusion/json.py +++ b/facefusion/json.py @@ -9,7 +9,7 @@ from facefusion.typing import Content def read_json(json_path : str) -> Optional[Content]: if is_file(json_path): try: - with open(json_path, 'r') as json_file: + with open(json_path) as json_file: return json.load(json_file) except JSONDecodeError: pass diff --git a/facefusion/processors/pixel_boost.py b/facefusion/processors/pixel_boost.py index 13665c0..8282f35 100644 --- a/facefusion/processors/pixel_boost.py +++ b/facefusion/processors/pixel_boost.py @@ -13,6 +13,6 @@ def implode_pixel_boost(crop_vision_frame : VisionFrame, pixel_boost_total : int def explode_pixel_boost(temp_vision_frames : List[VisionFrame], pixel_boost_total : int, model_size : Size, pixel_boost_size : Size) -> VisionFrame: - crop_vision_frame = numpy.stack(temp_vision_frames, axis = 0).reshape(pixel_boost_total, pixel_boost_total, model_size[0], model_size[1], 3) + crop_vision_frame = numpy.stack(temp_vision_frames).reshape(pixel_boost_total, pixel_boost_total, model_size[0], model_size[1], 3) crop_vision_frame = crop_vision_frame.transpose(2, 0, 3, 1, 4).reshape(pixel_boost_size[0], pixel_boost_size[1], 3) return crop_vision_frame diff --git a/facefusion/program.py b/facefusion/program.py index 7e7a42c..db85bb7 100755 --- a/facefusion/program.py +++ b/facefusion/program.py @@ -291,7 +291,7 @@ def create_program() -> ArgumentParser: sub_program.add_parser('job-run-all', help = wording.get('help.job_run_all'), parents = [ create_config_path_program(), create_temp_path_program(), create_jobs_path_program(), collect_job_program() ], formatter_class = create_help_formatter_large) sub_program.add_parser('job-retry', help = wording.get('help.job_retry'), parents = [ create_job_id_program(), create_config_path_program(), create_temp_path_program(), create_jobs_path_program(), collect_job_program() ], formatter_class = create_help_formatter_large) sub_program.add_parser('job-retry-all', help = wording.get('help.job_retry_all'), parents = [ create_config_path_program(), create_temp_path_program(), create_jobs_path_program(), collect_job_program() ], formatter_class = create_help_formatter_large) - return ArgumentParser(parents = [ program ], formatter_class = create_help_formatter_small, add_help = True) + return ArgumentParser(parents = [ program ], formatter_class = create_help_formatter_small) def apply_config_path(program : ArgumentParser) -> None: diff --git a/facefusion/uis/core.py b/facefusion/uis/core.py index 806f004..a7a5469 100644 --- a/facefusion/uis/core.py +++ b/facefusion/uis/core.py @@ -194,4 +194,4 @@ def get_theme() -> gradio.Theme: def get_css() -> str: overrides_css_path = resolve_relative_path('uis/assets/overrides.css') - return open(overrides_css_path, 'r').read() + return open(overrides_css_path).read() diff --git a/facefusion/vision.py b/facefusion/vision.py index 2ca3662..06773e3 100644 --- a/facefusion/vision.py +++ b/facefusion/vision.py @@ -11,7 +11,7 @@ from facefusion.filesystem import get_file_extension, is_image, is_video from facefusion.typing import Duration, Fps, Orientation, Resolution, VisionFrame -@lru_cache(maxsize = 128) +@lru_cache() def read_static_image(image_path : str) -> Optional[VisionFrame]: return read_image(image_path)