> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze assets


When uploading assets to your Cloudinary product environment, you can request different types of analysis to be performed on the assets.  In addition to the functionality detailed below, Cloudinary has a number of [add-ons](cloudinary_add_ons) that enable various types of analysis.

{table:class=no-borders overview} Page|Description
---|---
[Image quality analysis](image_quality_analysis) | Determine the quality of images uploaded to your product environment.
[Accessibility analysis](accessibility_analysis) | Analyze your images for accessibility and select the best images for people with color blindness.
[Semantic data extraction](semantic_data_extraction) | Extract additional semantic data from an image such as media metadata, pHash, ETag, color histogram, and more.
[Media Inspector browser extension](media_inspector_browser_extension) | Analyze your delivered images and videos in the browser to see the effect of the transformations and optimizations applied to the assets.
[Analyze API (Beta)](analyze_api_guide) | A method for analyzing any **external asset** and returning details based on the type of analysis requested.

> **TIP**:
>
> You can also run your own analysis by specifying custom logic with JavaScript when uploading assets:

> * [Evaluating and modifying upload parameters](upload_parameters#eval_modify_upload_options_before_upload) can be useful for conditionally adding tags, contextual metadata, structured metadata or eager transformations depending on specific criteria of the uploaded file. Your code will be evaluated before the file itself is uploaded. 

> * [Executing an update script](upload_parameters#on_success_update_metadata_after_upload) can be useful for conditionally adding tags, contextual metadata, and structured metadata, depending on the results of using the `detection` parameter on upload. Your code will be evaluated after the file itself is uploaded.

## Sample project: Computer vision demo

This sample project demonstrates using Cloudinary's analysis capabilities. The user can upload up to 3 images. Cloudinary analyzes the images and returns automatically transformed results along with a description. You'll see a message for images that don't pass moderation.

The image below shows sample output: two uploaded images analyzed for detected text, faces, orientation, and predominant colors. The transformations apply face masks, add borders based on the predominant color, and use a phone image as an underlay.

> **TIP**: :title=Go to the code

See the [GitHub](https://github.com/cloudinary-devs/computer-vision-demo) repo.

#### Setup instructions (after cloning from GitHub)

1. **Enable required add-ons**
   Go to the [Add-ons](https://console.cloudinary.com/app/settings/addons) page of the Console Settings and enable:
   * **Google Auto Tagging**
   * **OCR Text Detection and Extraction**
   * **Amazon Rekognition AI Moderation**

2. **Create a virtual environment**
   
    ```Terminal
    python3 -m venv venv
    ```

3. **Activate your virtual environment**
   
    ```Terminal
    source venv/bin/activate
    ```

4. **Install dependencies**
   
    ```Terminal
    pip install -r requirements.txt
    ```

5. **Create a `.env` file**
   Add the following environment variable:
  
    ```Terminal
    CLOUDINARY_URL=cloudinary://<api_key>:<api_secret>@<cloud_name>
    ``` 
   
6. **Replace placeholders**
   Update the `.env` file with your Cloudinary credentials, which you can find in the [API Keys](https://console.cloudinary.com/app/settings/api-keys) page of the Console Settings.

7. **Update the `cloudName` value**
   In `index.html`, replace the value for `cloudName` with your Cloudinary cloud name.

8. **(First-time only) Create the upload preset**
   In `demo.py`, uncomment the following block inside the `index()` route the first time you run the app:

    ```python
      # Create the upload preset only once:
      cloudinary.api.create_upload_preset(
        name = "docs_computer_vision_demo",
        unsigned = True,  
        use_filename=True,
        folder="docs/computer_vision_demo",
        tags="computer_vision_demo",
        colors= True,
        faces= True,
        categorization = "google_tagging", auto_tagging = 0.7,
        ocr = "adv_ocr",
        moderation = "aws_rek"
      )
      ```

    > **NOTE**: Remember to replace the comments after the first run.

   
9.  **Run the Flask app**
    
    ```Terminal
    python demo.py
    ```

Go to [GitHub](https://github.com/cloudinary-devs/computer-vision-demo) to try it out:

  
  
  
 

