2

I tried to convert YOLO v5 format to fiftyone format from this site.

The original code is below.


import fiftyone as fo

name = "my-dataset2"
dataset_dir = "/content/drive/MyDrive/yolo/yolov5/training/data"

# Create the dataset
dataset = fo.Dataset.from_dir(
    dataset_dir=dataset_dir,
    dataset_type=fo.types.YOLOv5Dataset,
    name=name,
)

# View summary info about the dataset
print(dataset)

# Print the first few samples in the dataset
print(dataset.head())

However, I got the following error:

00% |█████████████████████| 0/0 [1.1ms elapsed, ? remaining, ? samples/s] 
Name:        my-dataset2
Media type:  None
Num samples: 0
Persistent:  False
Tags:        []
Sample fields:
    id:           fiftyone.core.fields.ObjectIdField
    filepath:     fiftyone.core.fields.StringField
    tags:         fiftyone.core.fields.ListField(fiftyone.core.fields.StringField)
    metadata:     fiftyone.core.fields.EmbeddedDocumentField(fiftyone.core.metadata.Metadata)
    ground_truth: fiftyone.core.fields.EmbeddedDocumentField(fiftyone.core.labels.Detections)
[]

I don't know what is causing this error, any guidance would be really appreciated!

Woodford
  • 3,746
  • 1
  • 15
  • 29
  • Can you clarify the structure of the directory that contains your dataset? Generally, when a dataset importer doesn't throw errors and loads an empty dataset, it is because it didn't find what it was looking for in the place it was looking. The YOLOv5 importer specifically expects [this format](https://voxel51.com/docs/fiftyone/user_guide/dataset_creation/datasets.html#yolov5dataset) which contains a `dataset.yaml` file along with `images` and `labels` folders that each contain `train` and `val` folders. We're working on raising warnings that make the specific issues more clear. – Eric Hofesmann Aug 26 '21 at 16:17
  • I understand. I will reconfirm the structure of the folder once. – Ryotaro Harada Aug 28 '21 at 13:23
  • Sorry for the late reply. I no longer have to do this. Maybe I will use fIftyone again, so I will ask another question again at that time. Thank you for your helpful advice. – Ryotaro Harada Sep 08 '21 at 06:43

0 Answers0