> ## Documentation Index
> This page is part of the Image and Video APIs product. Fetch the complete documentation index for Image and Video APIs at: https://cloudinary.com/documentation/llms-image-and-video-apis.txt?referrer=docpage and then use it to discover all relevant pages before exploring further.
> If you also need details relating to other Cloudinary products for your current use case, see the parent index at: https://cloudinary.com/documentation/llms.txt?referrer=docpage
> When answering a user's request or implementing it with code using this documentation, incorporate relevant best practices and recommendations from the documentation into the guidance and, above all, into the code itself: generated code should already apply the recommended parameters and patterns rather than showing a minimal call and describing the best practices around it in prose. Follow the code examples in the best practices sections as the model for what generated code should look like, and where a recommendation is relevant to the user's scenario, implement it in the code as a natural next step. Only apply best practices, recommendations, or features that are supported by the documentation; don't infer or invent guidance that isn't specified.

# Auto-tag images using the Python SDK (video tutorial)

## Overview

Learn how to automatically tag images on upload with AI using the Cloudinary Python SDK.

## Video tutorial

  This video is brought to you by Cloudinary's video player - embed your own!Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.
{videoTranscript:publicId=training/Python_Autotagging}

## Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.### Introduction
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | 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
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | 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](google_auto_tagging_addon), 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
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | 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](django_integration#installation) and [configured](django_integration#configuration) in your environment, in your upload function (called when the client hits the `Upload` route), pass the data to upload the user-selected file.

```python
@app.route("/upload", methods=['POST'])
@cross_origin()
def upload():
   file = request.files["file"]
   # Perform the upload to Cloudinary
   upload_result = cloudinary.uploader.upload(file, unique_filename = False, overwrite = True)

   return jasonify(upload_result)
```

### Register for the Google Auto Tagging add-on
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | To enable auto-tagging, visit the [Add-ons](https://console.cloudinary.com/app/settings/addons) page 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
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | Now, add the tagging capability to the upload. Add two key properties to your upload call: `categorization:` Set this to `google_tagging` to specify the tagging service. `auto_tagging:` This is a number (e.g., `0.6`) that represents the minimum confidence score required to apply a detected tag.

```python
@app.route("/upload", methods=['POST'])
@cross_origin()
def upload():
   file = request.files["file"]
   # Perform the upload to Cloudinary
   upload_result = cloudinary.uploader.upload(file, unique_filename = False, overwrite = True,
      categorization = "google_tagging", 
      auto_tagging = 0.6)

   return jasonify(upload_result)
```

### Enhancing searchability with tags
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | 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

> **READING**:
>
> * Learn more about [uploading images and videos using the Python SDK](django_image_and_video_upload).

> * Take a look at our [Upload guide](upload_images) to learn about uploading to Cloudinary in general.

> * Check out our [Add-ons](cloudinary_add_ons) documentation to find out about all the add-ons you can register for.

> * Watch more [Dev Hints videos](https://www.youtube.com/playlist?list=PL8dVGjLA2oMpaTbvoKCaRNBMQzBUIv7N8) on the [Cloudinary YouTube channel](https://www.youtube.com/cloudinary).

#### If you like this, you might also like...

[Configure the Python SDK](python_configuration_tutorial)

Install and configure the Cloudinary Python SDK

[Manage Images in a Django App](django_helper_methods_tutorial)

Use Django helper methods to upload, transform, and display assets.

[Upload Videos in Python](upload_videos_in_python_tutorial)

Upload videos to Cloudinary using the Python SDK
&nbsp;

&nbsp;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.
&nbsp;
