Skip to content

Evaluation Endpoints

This is a very custom OpenAPI schema


Overview

Method Endpoint Description
POST /api/v1/evaluation/ Evaluate Image
GET /api/v1/evaluation/health Get Evaluator Health

API Reference

Custom API - Evaluation 1.0.0

This is a very custom OpenAPI schema


evaluation


POST /api/v1/evaluation/

Evaluate Image

Description

Evaluate an image for comprehensive shot analysis.

Args: request: Image evaluation request with expected shot type evaluator: Injected ShotEvaluator instance

Returns: Comprehensive evaluation result including shot type, human presence, anatomy analysis, gender detection, and optional descriptions

Raises: HTTPException: If evaluation fails or service is unavailable

Input parameters

Parameter In Type Default Nullable Description
HTTPBearer header string N/A No JWT Bearer token
provider query No

Request body

{
    "image_data": null,
    "image_url": null,
    "expected_framing": "full_body",
    "expected_view_angle": "front",
    "expected_gender": null,
    "custom_instructions": null,
    "include_descriptions": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "image_data": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Image Data",
            "description": "Base64-encoded image data (data:image/jpeg;base64,... format)"
        },
        "image_url": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Image Url",
            "description": "URL to image file"
        },
        "expected_framing": {
            "$ref": "#/components/schemas/Framing",
            "description": "Expected framing type for the image"
        },
        "expected_view_angle": {
            "$ref": "#/components/schemas/ViewAngle",
            "description": "Expected view angle for the image"
        },
        "expected_gender": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/Gender"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Expected gender for the image",
            "default": "FEMALE"
        },
        "custom_instructions": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Custom Instructions",
            "description": "Custom instructions for the evaluation"
        },
        "include_descriptions": {
            "type": "boolean",
            "title": "Include Descriptions",
            "description": "Include garment and subject descriptions",
            "default": false
        }
    },
    "type": "object",
    "required": [
        "expected_framing",
        "expected_view_angle"
    ],
    "title": "EvaluationRequest",
    "description": "Schema for evaluation API requests."
}

Responses

{
    "success": true,
    "detected_framing": null,
    "detected_view_angle": null,
    "shot_type_confidence": null,
    "matches_expected": null,
    "human_detected": null,
    "number_of_people": null,
    "human_presence_confidence": null,
    "anatomy_correct": null,
    "anatomy_issues": null,
    "anatomy_confidence": null,
    "detected_gender": null,
    "gender_confidence": null,
    "garment_description": null,
    "subject_description": null,
    "scene_description": null,
    "collage_detected": null,
    "error": null,
    "evaluation_time_ms": null,
    "confidence_summary": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "success": {
            "type": "boolean",
            "title": "Success",
            "description": "Whether the evaluation was successful"
        },
        "detected_framing": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/Framing"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Detected framing type"
        },
        "detected_view_angle": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/ViewAngle"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Detected view angle"
        },
        "shot_type_confidence": {
            "anyOf": [
                {
                    "type": "number",
                    "maximum": 1.0,
                    "minimum": 0.0
                },
                {
                    "type": "null"
                }
            ],
            "title": "Shot Type Confidence",
            "description": "Confidence score for shot type detection"
        },
        "matches_expected": {
            "anyOf": [
                {
                    "type": "boolean"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Matches Expected",
            "description": "Whether detected shot type matches expected"
        },
        "human_detected": {
            "anyOf": [
                {
                    "type": "boolean"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Human Detected",
            "description": "Whether humans were detected in the image"
        },
        "number_of_people": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Number Of People",
            "description": "Number of people detected"
        },
        "human_presence_confidence": {
            "anyOf": [
                {
                    "type": "number",
                    "maximum": 1.0,
                    "minimum": 0.0
                },
                {
                    "type": "null"
                }
            ],
            "title": "Human Presence Confidence",
            "description": "Confidence score for human detection"
        },
        "anatomy_correct": {
            "anyOf": [
                {
                    "type": "boolean"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Anatomy Correct",
            "description": "Whether anatomy appears correct"
        },
        "anatomy_issues": {
            "anyOf": [
                {
                    "items": {
                        "$ref": "#/components/schemas/AnatomyIssue"
                    },
                    "type": "array"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Anatomy Issues",
            "description": "List of detected anatomy issues"
        },
        "anatomy_confidence": {
            "anyOf": [
                {
                    "type": "number",
                    "maximum": 1.0,
                    "minimum": 0.0
                },
                {
                    "type": "null"
                }
            ],
            "title": "Anatomy Confidence",
            "description": "Confidence score for anatomy analysis"
        },
        "detected_gender": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/Gender"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Detected gender"
        },
        "gender_confidence": {
            "anyOf": [
                {
                    "type": "number",
                    "maximum": 1.0,
                    "minimum": 0.0
                },
                {
                    "type": "null"
                }
            ],
            "title": "Gender Confidence",
            "description": "Confidence score for gender detection"
        },
        "garment_description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Garment Description",
            "description": "Description of garments in the image"
        },
        "subject_description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Subject Description",
            "description": "Description of the subject"
        },
        "scene_description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Scene Description",
            "description": "Description of the scene"
        },
        "collage_detected": {
            "anyOf": [
                {
                    "type": "boolean"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Collage Detected",
            "description": "Whether a collage or stitched image was detected"
        },
        "error": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Error",
            "description": "Error message if evaluation failed"
        },
        "evaluation_time_ms": {
            "anyOf": [
                {
                    "type": "number"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Evaluation Time Ms",
            "description": "Time taken for evaluation in milliseconds"
        },
        "confidence_summary": {
            "anyOf": [
                {
                    "type": "number",
                    "maximum": 1.0,
                    "minimum": 0.0
                },
                {
                    "type": "null"
                }
            ],
            "title": "Confidence Summary",
            "description": "Average confidence across all evaluations"
        }
    },
    "type": "object",
    "required": [
        "success"
    ],
    "title": "EvaluationResponse",
    "description": "Schema for evaluation API responses."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/evaluation/health

Get Evaluator Health

Description

Get evaluator health status and metrics.

Args: evaluator: Injected ShotEvaluator instance

Returns: Current health status and performance metrics

Raises: HTTPException: If health check fails

Input parameters

Parameter In Type Default Nullable Description
HTTPBearer header string N/A No JWT Bearer token
provider query No

Responses

{
    "is_healthy": true,
    "health_score": 10.12,
    "total_evaluations": 0,
    "success_rate": 10.12,
    "average_response_time": 10.12,
    "circuit_breaker_state": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "is_healthy": {
            "type": "boolean",
            "title": "Is Healthy",
            "description": "Whether the evaluator is healthy"
        },
        "health_score": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Health Score",
            "description": "Health score (0.0-1.0)"
        },
        "total_evaluations": {
            "type": "integer",
            "title": "Total Evaluations",
            "description": "Total number of evaluations performed"
        },
        "success_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Success Rate",
            "description": "Success rate (0.0-1.0)"
        },
        "average_response_time": {
            "type": "number",
            "title": "Average Response Time",
            "description": "Average response time in seconds"
        },
        "circuit_breaker_state": {
            "type": "string",
            "title": "Circuit Breaker State",
            "description": "Circuit breaker state"
        }
    },
    "type": "object",
    "required": [
        "is_healthy",
        "health_score",
        "total_evaluations",
        "success_rate",
        "average_response_time",
        "circuit_breaker_state"
    ],
    "title": "HealthStatus",
    "description": "Schema for evaluator health status."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

AnatomyIssue

Type: string

EvaluationRequest

Name Type Description
custom_instructions Custom instructions for the evaluation
expected_framing Framing Expected framing type for the image
expected_gender Expected gender for the image
expected_view_angle ViewAngle Expected view angle for the image
image_data Base64-encoded image data (data:image/jpeg;base64,... format)
image_url URL to image file
include_descriptions boolean Include garment and subject descriptions

EvaluationResponse

Name Type Description
anatomy_confidence Confidence score for anatomy analysis
anatomy_correct Whether anatomy appears correct
anatomy_issues List of detected anatomy issues
collage_detected Whether a collage or stitched image was detected
confidence_summary Average confidence across all evaluations
detected_framing Detected framing type
detected_gender Detected gender
detected_view_angle Detected view angle
error Error message if evaluation failed
evaluation_time_ms Time taken for evaluation in milliseconds
garment_description Description of garments in the image
gender_confidence Confidence score for gender detection
human_detected Whether humans were detected in the image
human_presence_confidence Confidence score for human detection
matches_expected Whether detected shot type matches expected
number_of_people Number of people detected
scene_description Description of the scene
shot_type_confidence Confidence score for shot type detection
subject_description Description of the subject
success boolean Whether the evaluation was successful

Framing

Type: string

Gender

Type: string

HealthStatus

Name Type Description
average_response_time number Average response time in seconds
circuit_breaker_state string Circuit breaker state
health_score number Health score (0.0-1.0)
is_healthy boolean Whether the evaluator is healthy
success_rate number Success rate (0.0-1.0)
total_evaluations integer Total number of evaluations performed

HTTPValidationError

Name Type Description
detail Array<ValidationError>

ValidationError

Name Type Description
loc Array<>
msg string
type string

ViewAngle

Type: string

Security schemes

Name Type Scheme Description
HTTPBearer http bearer