update nudenet

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-04-09 13:48:54 +02:00
parent f1d2888f10
commit 14ba5e4ce7
8 changed files with 85 additions and 43 deletions
+2 -1
View File
@@ -42,11 +42,12 @@ def prompt_check(
def image_guard(
image: str = Body("", title='input image'),
policy: str = Body("", title='optional policy definition'),
model: str = Body("", title='optional policy model name'),
):
"""Evaluate an image against a content policy using the ImageGuard classifier."""
from scripts.nudenet import imageguard # pylint: disable=no-name-in-module
image = api.decode_base64_to_image(image)
res = imageguard.image_guard(image=image, policy=policy)
res = imageguard.image_guard(image=image, policy=policy, model_name=model)
return res