Media Tagging
garf for Media Tagging API
garf-media-tagging simplifies interaction with media_tagging library via
SQL queries and can be used with garf framework.
Prerequisites
- media_tagging library installed locally or running as a HTTP service.
Installation
pip install garf-media-tagging
Usage
Run via CLI
Install
garf-executorspackage to run queries via CLI (pip install garf-executors).
garf <PATH_TO_QUERIES> --source media-tagging \
--output <OUTPUT_TYPE> \
--source.endpoint=MEDIA_TAGGING_API_ENDPOINT_URL
where:
PATH_TO_QUERIES- local or remove files containing queriesoutput- output supported bygarf-iolibrary.SOURCE_PARAMETER=VALUE- key-value pairs to refine fetching, check available source parameters.
Available source parameters
| name | values | comments |
|---|---|---|
endpoint |
http endpoint when media-tagging API is running | |
db-uri |
Optional connection string to DB where tagging results can be found |
Queries for Media Tagging API
SELECT
media_url,
content.tags[].name AS tags
FROM tag
WHERE
media_type = 'image'
AND tagger_type = 'gemini'
AND media_path IN ({{media}})
Resources
tag- identifies tags (pairname: score) uniquely defining media.description- custom description of media; usually fine-tuned viacustom_promptparameter.
Filters
media_type- Required, one of: IMAGE, YOUTUBE_VIDEO, WEBPAGE, TEXT, VIDEO.tagger_type- Tagger used to identify tags / descriptions.media_path- location of media.tagging_options- optional parameters to fine-tune tagging.n_tags- number of tags to return.tags- custom tags to find in the media.custom_prompt- prompt to send to LLM.custom_schema- schema for structured output.
Fields
You can extract one of the following elements from reach row of API response.
media_typemedia_urlidentifierprocessed_atcontenttextfor description{name, score}for tag
hash