From c00e9454085ef3e96b98a1ded81aad6a3b95d849 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期四, 31 七月 2025 22:20:08 +0800
Subject: [PATCH] add video matting
---
auto_media_publisher/modifiers/face_swap/face_nsfw_predictor.py | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/auto_media_publisher/modifiers/face_swap/face_nsfw_predictor.py b/auto_media_publisher/modifiers/face_swap/face_nsfw_predictor.py
index 8cc5f96..8a2eb7a 100644
--- a/auto_media_publisher/modifiers/face_swap/face_nsfw_predictor.py
+++ b/auto_media_publisher/modifiers/face_swap/face_nsfw_predictor.py
@@ -1,10 +1,7 @@
-import threading
import numpy as np
from PIL import Image
-from keras import Model
import opennsfw2
-from .typing import Frame # 浣犲凡鏈夊畾涔�
MAX_PROBABILITY = 0.85
@@ -12,7 +9,7 @@
def __init__(self):
self._predictor = opennsfw2.make_open_nsfw_model()
- def predict_frame(self, frame: Frame) -> bool:
+ def predict_frame(self, frame: np.ndarray) -> bool:
image = Image.fromarray(frame)
image = opennsfw2.preprocess_image(image, opennsfw2.Preprocessing.YAHOO)
views = np.expand_dims(image, axis=0)
--
Gitblit v1.9.1