Raphtalia / facefusion /content_analyser.py
Premo4153's picture
Upload 235 files
3914b35 verified
from functools import lru_cache
from typing import List
import numpy
from tqdm import tqdm
from facefusion import inference_manager, state_manager, wording
from facefusion.download import conditional_download_hashes, conditional_download_sources, resolve_download_url
from facefusion.filesystem import resolve_relative_path
from facefusion.thread_helper import conditional_thread_semaphore
from facefusion.types import Detection, DownloadScope, Fps, InferencePool, ModelOptions, ModelSet, Score, VisionFrame
from facefusion.vision import detect_video_fps, fit_frame, read_image, read_video_frame
STREAM_COUNTER = 0
@lru_cache(maxsize=None)
def create_static_model_set(download_scope: DownloadScope) -> ModelSet:
return {
'yolo_nsfw': {
'hashes': {},
'sources': {},
'size': (640, 640)
}
}
def get_inference_pool() -> InferencePool:
return {} # βœ… NSFW model pool disabled
def clear_inference_pool() -> None:
pass # βœ… No NSFW inference clearing needed
def get_model_options() -> ModelOptions:
return {} # βœ… No NSFW model options
def pre_check() -> bool:
return True # βœ… Always return True (Skip NSFW model check)
def analyse_stream(vision_frame: VisionFrame, video_fps: Fps) -> bool:
return False # βœ… No NSFW analysis
def analyse_frame(vision_frame: VisionFrame) -> bool:
return False # βœ… No NSFW detection
@lru_cache(maxsize=None)
def analyse_image(image_path: str) -> bool:
return False # βœ… No NSFW check for images
@lru_cache(maxsize=None)
def analyse_video(video_path: str, trim_frame_start: int, trim_frame_end: int) -> bool:
return False # βœ… No NSFW check for videos
def detect_nsfw(vision_frame: VisionFrame) -> List[Score]:
return [] # βœ… Always return empty NSFW scores (No detection)
def forward(vision_frame: VisionFrame) -> Detection:
return [] # βœ… No detection happening
def prepare_detect_frame(temp_vision_frame: VisionFrame) -> VisionFrame:
return temp_vision_frame # βœ… No modifications needed