No project description provided
Project description
Media Tagger
Problem statement
When analyzing large amount of creatives of any nature (being images and videos) it might be challenging to quickly and reliably understand their content and gain insights.
Solution
media-tagger
performs tagging of image and videos based on various taggers
- simply provide a path to your media files and
media-tagger
will do the rest.
Deliverable (implementation)
media-tagger
is implemented as a:
- library - Use it in your projects with a help of
media_tagging.tagger.create_tagger
function. - CLI tool -
media-tagger
tool is available to be used in the terminal. - HTTP endpoint -
media-tagger
can be easily exposed as HTTP endpoint. - Langchain tool - integrated
media-tagger
into your Langchain applications.
Deployment
Prerequisites
- Python 3.11+
- A GCP project with billing account attached
- Video Intelligence API and Vision API enabled.
- API key to access to access Google Gemini.
-
Once you created API key export it as an environmental variable
export GOOGLE_API_KEY=<YOUR_API_KEY_HERE>
-
Installation
Install media-tagger
with pip install media-tagging
command.
Usage
This section is focused on using
media-tagger
as a CLI tool. Check library, http endpoint, langchain tool sections to learn more.
Once media-tagger
is installed you can call it:
media-tagger --media-path MEDIA_PATH --tagger TAGGER_TYPE --writer WRITER_TYPE
where:
- MEDIA_PATH - comma-separated names of files for tagging (can be urls).
- TAGGER_TYPE - name of tagger, supported options:
vision-api
- tags images based on Google Cloud Vision API,video-api
for videos based on Google Cloud Video Intelligence APIgemini-image
- Uses Gemini to tags images. Add--tagger.n_tags=<N_TAGS>
parameter to control number of tags returned by tagger.gemini-structured-image
- Uses Gemini to find certain tags in the images. Add--tagger.tags='tag1, tag2, ..., tagN
parameter to find certain tags in the image.gemini-description-image
- Provides brief description of the image,
- WRITER_TYPE - name of writer, one of
csv
,json
By default script will create a single file with tagging results for each media_path.
If you want to combine results into a single file add --output OUTPUT_NAME
flag (without extension, i.e. --output tagging_sample
.
Disclaimer
This is not an officially supported Google product.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file media_tagging-0.4.0.tar.gz
.
File metadata
- Download URL: media_tagging-0.4.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e473b43ebcebfeb7373699da805bc9994b6ab3988424c7132e1a465e0bc1a556 |
|
MD5 | 59199b820f5600ac19db7ba11f9e603c |
|
BLAKE2b-256 | cd5a76a0a73b5996bdc5e65a326bc40ecf55f601d72c0088a6e2bc41d4b870a5 |