From 6d28a52869d456e2d1fb6a92833a70a64819ae2c Mon Sep 17 00:00:00 2001 From: Vic P Date: Wed, 21 Aug 2024 02:14:37 +0700 Subject: [PATCH] Update codes following the comments of @sourcery-ai. Signed-off-by: Vic P --- README.md | 2 +- modules/predicter.py | 1 + modules/ui.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 800e7a8..07f7f16 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ options: --keep-audio keep original audio --keep-frames keep temporary frames --many-faces process every face - --nsfw-filter filter the NSFW image or video. + --nsfw-filter filter the NSFW image or video --video-encoder {libx264,libx265,libvpx-vp9} adjust output video encoder --video-quality [0-51] adjust output video quality --max-memory MAX_MEMORY maximum amount of RAM in GB diff --git a/modules/predicter.py b/modules/predicter.py index 8467f72..dbb680e 100644 --- a/modules/predicter.py +++ b/modules/predicter.py @@ -6,6 +6,7 @@ from modules.typing import Frame MAX_PROBABILITY = 0.85 +# Preload the model once for efficiency model = None def predict_frame(target_frame: Frame) -> bool: diff --git a/modules/ui.py b/modules/ui.py index b699f4c..b874175 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -193,7 +193,7 @@ def select_output_path(start: Callable[[], None]) -> None: def check_and_ignore_nsfw(target, destroy: Callable = None) -> bool: - ''' Check the target is NSFW or not. + ''' Check if the target is NSFW. TODO: Consider to make blur the target. ''' from numpy import ndarray