Object Detection
Image · HuggingFace · Visual
The Object Detection detector runs any HuggingFace object-detection pipeline on image assets. Each detected object becomes a finding with bounding box coordinates, confidence score, and the object label. A severity_map maps specific labels to severity levels for downstream routing.
When to use
- Sensitive object detection — flag images containing weapons, ID documents, medical devices, or other controlled objects.
- Workplace safety — detect missing personal protective equipment (PPE) in facility photos or video frames.
- Brand compliance — locate specific logos or product placements in marketing assets.
- Data loss prevention — identify screenshots or photos that contain whiteboards, screens, or handwritten notes with potential data exposure.
- Asset cataloguing — automatically tag images by the objects they contain to support structured search and filtering.
How it works
Classifyre runs the HuggingFace object-detection pipeline on each image asset. Each detected instance above confidence_threshold produces a separate finding with bbox (bounding box coordinates), score, and label in the finding metadata.
Use top_k to limit detections per image to the highest-confidence results. The optional nms_threshold controls non-maximum suppression — lower values remove more overlapping detections. min_box_area discards small-area detections that are likely noise.
Configuration
| Parameter | Type | Required | Description | Default | Constraints |
|---|---|---|---|---|---|
| model | string | Yes | HuggingFace hub ID (e.g. 'facebook/detr-resnet-50', 'hustvl/yolos-small') or absolute local directory path. | — | — |
| model_revision | string | No | Git branch, tag, or commit hash when fetching from the HuggingFace hub. | null | — |
| device | string | No | Inference device: 'cpu' (default), 'cuda', 'mps', or a CUDA device string like 'cuda:0'. | cpu | — |
| confidence_threshold | number | No | Minimum detection confidence to report an object as a finding (0-1). | 0.5 | min 0, max 1 |
| top_k | integer | No | Keep only the top-k highest-confidence detections per image. | null | — |
| nms_threshold | number | No | IoU threshold for non-maximum suppression. When null the model's default post-processing is used. | null | — |
| min_box_area | integer | No | Minimum bounding-box area in pixels (width × height). Smaller detections are suppressed. | null | — |
| severity_map | array | No | Ordered rules mapping detected object labels to severity levels. Labels with no matching rule receive 'info' severity. | null | — |
Examples
Detect weapons or sensitive objects
{
"type": "OBJECT_DETECTION",
"model": "facebook/detr-resnet-50",
"confidence_threshold": 0.7,
"severity_map": [
{ "label": "knife", "severity": "high" },
{ "label": "gun", "severity": "critical" }
],
"top_k": 20
}PPE compliance check
{
"type": "OBJECT_DETECTION",
"model": "keremberke/yolov8m-hard-hat-detection",
"confidence_threshold": 0.5,
"nms_threshold": 0.45,
"min_box_area": 400,
"severity_map": [
{ "label": "no-hardhat", "severity": "high" }
],
"severity": "info"
}