GroundingDINOClassification
Python template · sinapsis_huggingface_grounding_dino.templates.grounding_dino_classification
Overview
GroundingDINO model for image classification tasks.
This module provides an implementation of a zero-shot classification system using the GroundingDINO model. The classification pipeline allows for image classification tasks based on a predefined set of classes or text input.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-huggingface-grounding-dino==1.0.0uv pip install sinapsis-huggingface-grounding-dino==1.0.0uv add sinapsis-huggingface-grounding-dino==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
The maximum number of top predictions to return. Defaults to 5. This specifies an upper limit, and fewer predictions may be returned if the number of valid predictions is less than `top_k`.
Optional
Default: 5
Required
Default: null
Optional
Default: null
Optional
Default: 0.25
Optional
Default: "IDEA-Research/grounding-dino-base"
Input text for classification.
Optional
Default: null
Path to file containing classification classes.
Optional
Default: null
Required
Default: null
Optional
Default: 0.25
Optional
Default: "/home/ariel/.cache/sinapsis"
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: GroundingDINOClassification
class_name: GroundingDINOClassification
template_input: InputTemplate
attributes:
model_path: '/path/to/model'
model_cache_dir: /path/to/cache/dir
inference_mode: 'object_detection'
threshold: 0.25
text_threshold: 0.25
device: 'cuda'
classes_file: /file/where/classes/are/stored
text_input: object to detect
top_k: 5Show schema-based configuration skeleton
templates:
- template_name: "GroundingDINOClassification"
class_name: "GroundingDINOClassification"
attributes:
top_k: 5
device: "<required>"
threshold: 0.25
model_path: "IDEA-Research/grounding-dino-base"
text_input: null
classes_file: null
inference_mode: "<required>"
text_threshold: 0.25
model_cache_dir: "/home/ariel/.cache/sinapsis"
Inheritance
sinapsis_huggingface_grounding_dino.templates.grounding_dino.GroundingDINOEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.