Auto-tag images using the Python SDK (video tutorial)
Last updated: Feb-19-2025
On this page:
Overview
Learn how to automatically tag images on upload with AI using the Cloudinary Python SDK.
Video tutorial
Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Introduction
Storing a large number of images or videos in your Cloudinary Media Library is convenient, but finding a specific item can sometimes be a hassle. The solution? Adding tags to your content. However, manually adding tags to multiple files can be slow and tedious, especially with a big set of files. |
Adding tags to content manually and using add-ons
Cloudinary allows you to manually add tags to images for better organization and searchability. Alternatively, you can automate this process by registering for add-ons that enhance Cloudinary’s capabilities. One such add-on is Google Auto Tagging, which uses AI to auto-tag images during the upload process. Let’s see how to use this feature with Python and Flask. |
Set up an upload call in Flask
First, set up a simple upload call for uploading a local file to Cloudinary from your Flask app. Assuming the Cloudinary Python SDK is already installed and configured in your environment, in your upload function (called when the client hits the Upload route), pass the data to upload the user-selected file. |
Register for the Google Auto Tagging add-on
To enable auto-tagging, visit the Add-ons page in your Cloudinary Console Settings and register for the Google Auto Tagging add-on. Once activated, the auto-tagging feature is available during uploads. |
Add auto-tagging to the upload call
Now, add the tagging capability to the upload. Add two key properties to your upload call:
|
Enhancing searchability with tags
Launch the app and use it to upload an image. The upload response that's displayed in the app contains the tags assigned during the upload. In addition, the tags are stored with the image in the Media Library. These auto-generated tags make it much easier to search for images within your Media Library. For example, you can search for all images with the "deer" tag and quickly retrieve relevant results. |
Keep learning
Related topics
- Learn more about uploading images and videos using the Python SDK.
- Take a look at our Upload guide to learn about uploading to Cloudinary in general.
- Check out our Add-ons documentation to find out about all the add-ons you can register for.
- Watch more Dev Hints videos on the Cloudinary YouTube channel.
If you like this, you might also like...
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
✖️