added image ai-moderation
This commit is contained in:
10
ai-moderation/app/config/image_policy.py
Normal file
10
ai-moderation/app/config/image_policy.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# app/config/image_policy.py
|
||||
FORBIDDEN_IMAGE_LABELS = {
|
||||
s.lower() for s in {
|
||||
"a photo containing marijuana",
|
||||
"a photo containing drugs",
|
||||
"a photo containing weapons",
|
||||
"a pornographic photo",
|
||||
"a photo containing violence",
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,18 @@ class Settings(BaseSettings):
|
||||
|
||||
DEBUG: bool = True
|
||||
|
||||
TEXT_TOXIC_THRESHOLD: float = 0.90
|
||||
|
||||
|
||||
# ===== AI =====
|
||||
|
||||
TEXT_MODEL: str = "textdetox/bert-multilingual-toxicity-classifier"
|
||||
|
||||
|
||||
IMAGE_MODEL: str = "Falconsai/nsfw_image_detection"
|
||||
NSFW_THRESHOLD: float = 0.85
|
||||
IMAGE_CLIP_MODEL: str = "openai/clip-vit-base-patch32"
|
||||
CLIP_THRESHOLD: float = 0.75
|
||||
HF_TOKEN: str = "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"
|
||||
MODEL_CACHE_DIR: str = "./models"
|
||||
|
||||
DEVICE: str = "auto"
|
||||
|
||||
Reference in New Issue
Block a user