# How to import (map?) class names

**URL:** <https://discuss.roboflow.com/t/how-to-import-map-class-names/10476>\
**Category:** 🤝  Community Help\
**Created:** [July 3, 2025, 3:19pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476 "2025-07-03T15:19:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sp88011](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/sp88011/32/7841_2.png) [@sp88011](https://discuss.roboflow.com/u/sp88011)\
**Post date:** [July 3, 2025, 3:19pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/1 "2025-07-03T15:19:00Z")

</div>

Hi there - I’m new to the platform so this question is probably simple to answer. How do I get roboflow to recognize my class names? Right now, I only have numbers as classes because I use a `dataset.yaml` file to map numbers (open image v7) to names.

I have a dataset on my local machine. Standard folder structure:

```auto
/dataset
├── dataset.yaml
├── images
│ ├── train
│ └── val
└── labels
    ├── train
    └── val

```

I uploaded this using the CLI `roboflow import -w myupload -p myproject_id ./dataset`

My `dataset.yaml` contains the mapping of class names, like so

```auto
train: ./images/train/
val: ./images/val/
nc: 601
names:
  0: Accordion
  1: Adhesive tape
  2: Aircraft
  3: Airplane
...

```

On Roboflow, I only see numbers as class names.

Roboflow doesn’t seem to recognize the `dataset.yaml` at all when importing.

I have around 600 classes so ideally there’s a way to programmatically do the mapping?

I’m on the free plan and don’t really want to upgrade to do something as simple as mapping names - any ideas?

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/6/68ea4dd97eaeca28820f1b078a39eb5581f41d69.png)

---

<div class="post-metadata">

**Author:** ![Ford](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ford/32/7747_2.png) [@Ford](https://discuss.roboflow.com/u/Ford)\
**Post date:** [July 3, 2025, 6:24pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/2 "2025-07-03T18:24:05Z")

</div>

Hi @sp88011!  
Welcome to the Roboflow community!! I am sorry you have run into this issue. I am reaching out to the appropriate team and will keep you in the loop.

Thanks for your patience!

---

<div class="post-metadata">

**Author:** ![sp88011](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/sp88011/32/7841_2.png) [@sp88011](https://discuss.roboflow.com/u/sp88011)\
**Post date:** [July 7, 2025, 6:53pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/3 "2025-07-07T18:53:25Z")

</div>

thanks @Ford - any insights so far?

---

<div class="post-metadata">

**Author:** ![Ford](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ford/32/7747_2.png) [@Ford](https://discuss.roboflow.com/u/Ford)\
**Post date:** [July 7, 2025, 9:36pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/4 "2025-07-07T21:36:04Z")

</div>

Hi @sp88011!  
Thank you for your patience! In talking with our team, you can upload any format listed on our [accepted annotation formats](https://roboflow.com/formats) page. Otherwise you can manually convert to an accepted format and then upload images and annotations via the SDK, API, or web app.

You can drag and drop to upload annotations in the Roboflow web app. See the screenshot below:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/d/dfdb426c0e621c5e74e330babe14a4aa544f1b9f.png)

---

<div class="post-metadata">

**Author:** ![sp88011](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/sp88011/32/7841_2.png) [@sp88011](https://discuss.roboflow.com/u/sp88011)\
**Post date:** [July 7, 2025, 10:37pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/5 "2025-07-07T22:37:55Z")

</div>

Thanks for getting back to me, and sorry to be dense…it seems like the YOLOv5 format that you expect differs from the official one?

You expect:

```auto
nc: 3
names: ['head', 'helmet', 'person']
...

```

The [official YOLO v5 format](https://docs.ultralytics.com/datasets/detect/#ultralytics-yolo-format) looks like this:

```auto
...

# Classes
names:
  0: person
  11: bicycle
  20: car
  32: motorcycle
  99: airplane
...

```

So when trying to upload my `.yaml` file through the web app, the screen flashes quickly but nothing happens. No error message, no classes imported.

So I’m wondering whether my `.yaml` file just isn’t working for you due to its format.

---

<div class="post-metadata">

**Author:** ![Ford](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ford/32/7747_2.png) [@Ford](https://discuss.roboflow.com/u/Ford)\
**Post date:** [July 7, 2025, 11:02pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/6 "2025-07-07T23:02:09Z")

</div>

> [@sp88011](#):
>
> So when trying to upload my `.yaml` file through the web app, the screen flashes quickly but nothing happens. No error message, no classes imported.

Based upon this behavior, its important to note that annotations must be uploaded with their corresponding images in the same batch. If you attempt to upload annotations without their associated images, you receive this aforementioned behavior.

We will clarify this in the upload page, thank you for the feedback!!

---

<div class="post-metadata">

**Author:** ![sp88011](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/sp88011/32/7841_2.png) [@sp88011](https://discuss.roboflow.com/u/sp88011)\
**Post date:** [July 8, 2025, 12:30am UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/7 "2025-07-08T00:30:12Z")

</div>

Okay, it seems like there may be a bug when you upload via the CLI.

When I use the web app and simply drag and drop my folder (`my-dataset`), the names of my classes are imported correctly.

When I use the CLI like so, the names are **not** imported:

`roboflow import -w my-user -p my-project-id ./datasets/my-dataset`

---

<div class="post-metadata">

**Author:** ![Ford](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ford/32/7747_2.png) [@Ford](https://discuss.roboflow.com/u/Ford)\
**Post date:** [July 8, 2025, 9:36pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/8 "2025-07-08T21:36:54Z")

</div>

Hi @sp88011!  
I’ve been testing this today and was able to replicate the disparity. Thank you for bringing this to our attention, I will notify the appropriate teams.

In the meantime, I suggest using the drag & drop upload while we address this. Thanks again for bringing this forward!

---

<div class="post-metadata">

**Author:** ![Ford](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ford/32/7747_2.png) [@Ford](https://discuss.roboflow.com/u/Ford)\
**Post date:** [July 9, 2025, 3:40pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/9 "2025-07-09T15:40:04Z")

</div>

Hi @sp88011!  
Great news! We’ve deployed the fix, please update your library to [Roboflow 1.2.1](https://pypi.org/project/roboflow/)

Roboflow now supports both List and Key-Value pair formatted data.yaml files for upload via the CLI.

```auto
nc: 3
names: ['head', 'helmet', 'person']
...

```

OR

```auto
...

# Classes
names:
  0: person
  11: bicycle
  20: car
  32: motorcycle
  99: airplane
...

```

Side note for community visibility. When installing the CLI, please install from [pypi](https://pypi.org/project/roboflow/) using `pip install roboflow`. Installing from [npm](https://www.npmjs.com/package/roboflow/v/0.2.0) will install a deprecated version.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [July 16, 2025, 3:41pm UTC](https://discuss.roboflow.com/t/how-to-import-map-class-names/10476/10 "2025-07-16T15:41:18Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
