Skip to main content

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-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

  • 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-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_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-api for videos based on Google Cloud Video Intelligence API
    • gemini-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

media_tagging-0.6.0.dev1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

media_tagging-0.6.0.dev1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file media_tagging-0.6.0.dev1.tar.gz.

File metadata

  • Download URL: media_tagging-0.6.0.dev1.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.1

File hashes

Hashes for media_tagging-0.6.0.dev1.tar.gz
Algorithm Hash digest
SHA256 cc4ecf64d34cb36c9ceb3591ed62e3e589e7b870bf253cd94bc6f627a71d174b
MD5 6dce66b8b71ddac026eeca0cf3c12115
BLAKE2b-256 7d8a6eecaaa68adccd8b7d3f93b9e72eeb35f8862a437c8b51c5740e330e5ed1

See more details on using hashes here.

File details

Details for the file media_tagging-0.6.0.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for media_tagging-0.6.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc01bd6c415506a4a975a9fa2a52a03b172141387212c3fde297c841a9721a53
MD5 e0f2d81ec664c0e7667ae773567f9ba5
BLAKE2b-256 ae867177aa2f4e996f8b8c070f9ca9de0b7ab9d158f02cbb812bee61d52bcd59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page