---
title: "Detect And Classify"
method: POST
path: "/v1/vision/detect_classify"
tags: ["vision", "vision-detect-classify"]
---

# Detect And Classify

`POST /v1/vision/detect_classify`

## Request

- The document declares no server URL.
- Auth: none declared

Detect objects then classify each crop — single round-trip.

Runs YOLO detection → crops each bounding box → CLIP classifies each crop.
Returns unified results with both detection and classification info.

## Request body

- DetectClassifyRequest
  - `image` string, required: Base64-encoded image
  - `detection_model` string: YOLO model for detection
  - `classification_model` string: CLIP model for classification
  - `classes` string[], required: Classes for zero-shot classification of each crop
  - `confidence_threshold` number: Detection confidence threshold
  - `detection_classes` string[], nullable: Filter detections to these YOLO classes
  - `top_k` integer: Top-K classification results per crop
  - `min_crop_px` integer: Minimum crop dimension in pixels (skip tiny detections)

## Response `200`

Successful Response

- DetectClassifyResponse
  - `results` ClassifiedDetection[], required
    - `box` BoundingBox, required
      - `x1` number, required
      - `y1` number, required
      - `x2` number, required
      - `y2` number, required
    - `detection_class` string, required
    - `detection_confidence` number, required
    - `classification` string, required
    - `classification_confidence` number, required
    - `all_scores` object, required
  - `total_detections` integer, required
  - `classified_count` integer, required
  - `detection_model` string, required
  - `classification_model` string, required
  - `detection_time_ms` number, required
  - `classification_time_ms` number, required
  - `total_time_ms` number, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/llama-farm/apis/llamafarm-edge-runtime.md) - [All operations](https://skmtc.dev/llama-farm/apis/llamafarm-edge-runtime/llms.txt) - [OpenAPI document](https://skmtc.dev/llama-farm/apis/llamafarm-edge-runtime/revisions/a23a9e72958b?raw)
