change image model

This commit is contained in:
SlimusMinus
2026-09-07 00:59:22 +03:00
parent 30c29d8280
commit 061bad8f67
6 changed files with 70 additions and 20 deletions

View File

@@ -3,8 +3,6 @@ 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",
}
}

View File

@@ -21,6 +21,9 @@ class Settings(BaseSettings):
NSFW_THRESHOLD: float = 0.85
IMAGE_CLIP_MODEL: str = "openai/clip-vit-base-patch32"
CLIP_THRESHOLD: float = 0.75
WEAPON_MODEL: str = "google/owlv2-base-patch16-ensemble"
WEAPON_THRESHOLD: float = 0.40
WEAPON_MIN_AREA_FRACTION: float = 0.005
MODEL_CACHE_DIR: str = "./models"
DEVICE: str = "auto"