Performs tagging of image and videos based on various taggers
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-taggerwill 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_taggerfunction. - CLI tool -
media-taggertool is available to be used in the terminal. - HTTP endpoint -
media-taggercan be easily exposed as HTTP endpoint. - Langchain tool - integrated
media-taggerinto 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[all] command.
Alternatively you can install subsets of media-tagging library:
media-tagging[api]- tagging videos and images with Google Cloud APIs.media-tagging[image-api]- only for tagging images.media-tagging[video-api]- only for tagging videos.
media-tagging[llm]- tagging videos and images with LLMs.media-tagging[base-llm]- only for tagging images with llms.media-tagging[google-genai]- only for tagging images via Gemini.media-tagging[google-vertexai]- only for tagging videos via Gemini.
Usage
This section is focused on using
media-taggeras 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_PATHs --tagger TAGGER_TYPE --writer WRITER_TYPE
where:
- MEDIA_PATHs - 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-apifor 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, ..., tagNparameter 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file media_tagging-0.7.1.post3.tar.gz.
File metadata
- Download URL: media_tagging-0.7.1.post3.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1abda6c06be19a84d1dad896255cb946b6ad3f84737a0f391a4de5e75dafcef
|
|
| MD5 |
419669053431d7c9d0035ab63f88f71f
|
|
| BLAKE2b-256 |
09247bc24feed605006e7c24c6d29e5935fddc12399d2b42c52b1c8c7593a04b
|
File details
Details for the file media_tagging-0.7.1.post3-py3-none-any.whl.
File metadata
- Download URL: media_tagging-0.7.1.post3-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae885882fc7f9bd498453f0218fee10c70e80997d21d936eeb38115e0a84689e
|
|
| MD5 |
ca5b2854d120f2fe6bff466f065f15e4
|
|
| BLAKE2b-256 |
4f0ed30cd63786bee4a9a875399db4dfe1b4ce61ef46c24e94e8ca15842da124
|