Export Image-Level Tags with Filenames in CSV Format

Hello Roboflow Community,

I’m working on a project where I’m using both annotation classes and image-level tags for my images, and I need to export both types of information into a single CSV file.

My Project Setup:

  • Annotation Classes: I have defined specific “Brand Names” (e.g., kind, dole, kelloggs, etc.) as classes for my object detection annotations. When I download my dataset (e.g., as CSV Multi Label Classification), I can successfully get the filename and the class (brand name) for each detected object in Hot encoded Format.
  • Image-Level Tags: Separately, I’ve used Roboflow’s image tagging feature to apply “Flavor” tags (e.g., chocolate, vanilla, strawberry, original) to images. These are applied at the image level in the dataset view (e.g., visible when Browse individual images or filtering).

The Issue: When I export my dataset to a CSV format (or any other format that generates a CSV-like structure), I only see the Brand Names (classes) associated with the annotations. The Flavor Tags that I’ve applied at the image level do not appear in the exported CSV.

My Desired Output Format: I would like a single CSV file that includes:

  • The filename
  • The Brand Name (Classes) (derived from the annotation classes)
  • The Flavor (Tags) associated with that image

Ideally, something like:

FileName | Brand Name(s) | Flavor Tag(s)
image1.jpg | kind | chocolate, original
image2.jpg | kelloggs | vanilla

(Where Brand Name(s) could be comma-separated if multiple objects of different brands are detected, and Flavor Tag(s) could be comma-separated if an image has multiple flavor tags).

My Question: Is there a straightforward way within Roboflow to export both the annotation classes (brands) and the tags (flavors) into a single CSV? Or, what is the recommended workflow to combine these two pieces of information after export? For example, is there a separate “metadata export” for image tags that I can then merge with an annotation export?

Any guidance on how to achieve this specific data combination would be greatly appreciated.

Thank you!

Hi @Vivek_Singh!
This is a fantastic question! At this moment, the best way to accomplish this task is to create a custom python script to combine the filename, classes, and tags into a single CSV. This is a great suggestion that I will relay to our team.

Here is a prompt you can implement to create a starter script:

I need a Python script that combines two CSV files into one. The first CSV contains
image filenames and annotation classes (brand names), while the second contains 
filenames and image-level tags (flavor tags). The script should merge both files on
 the `filename` column and output a new CSV with columns for `filename`, `classes`, 
and `tags`. The output CSV should include all filenames from the annotation file, 
even if there are no corresponding tags, and save it as `combined_output.csv`.

Thanks again for bringing this to our attention!

1 Like

Hello @Ford

Thank you for the quick reply and the Python script prompt! I appreciate you relaying the suggestion to your team regarding a more direct export.

However, I think there might still be a slight misunderstanding of my core issue. The Python script you provided relies on having two separate CSV files to begin with:

  1. A CSV with filename and annotation classes (which I can get from the Object Detection CSV export under “Versions”).
  2. A CSV with filename and image-level tags (flavors).

My actual issue is that I cannot find a way to export the dataset CSV file (the one with filename and tags) from Roboflow at all.

I have diligently applied tags to my images using the image tagging feature in Roboflow. However, when I look at the “Data” tab or any “Export” options within Roboflow, I haven’t found a dedicated way to download a CSV that specifically lists all my images and their associated image-level tags.

Could you please clarify how I can export a CSV containing just the filename and the image-level tags (my “flavors”) from my Roboflow project? Once I have that CSV, I can certainly use the Python script to combine it with my annotation classes.

Thanks again for your help!