Skip to content

Commit

Permalink
ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Jul 15, 2023
1 parent f38239e commit 9aa5023
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roop/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@

from roop.typing import Frame

PREDICTOR = None
THREAD_LOCK = threading.Lock()
MAX_PROBABILITY = 0.85


def get_predictor() -> Model:
global PREDICTOR

with THREAD_LOCK:
if PREDICTOR is None:
PREDICTOR = opennsfw2.make_open_nsfw_model()
return PREDICTOR


def clear_predictor() -> None:
global PREDICTOR

Expand Down

0 comments on commit 9aa5023

Please sign in to comment.