File size: 2,070 Bytes
3914b35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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