data-gradients icon indicating copy to clipboard operation
data-gradients copied to clipboard

Data gradients analysis for segmentation of dataset in yolo format

Open Soorajkumar3 opened this issue 2 years ago • 3 comments

💡 Your Question

Is this data gradient not available for segmentation analysis of dataset in yolo format?

Soorajkumar3 avatar Aug 13 '23 15:08 Soorajkumar3

Hi @Soorajkumar3 We don't provide a built-in class to instantiate a segmentation dataset that would be in YOLO format. But if you already have a dataset class that loads your data (YOLO format or any), then you can use it inside DataGradients.

Louis-Dupont avatar Aug 15 '23 07:08 Louis-Dupont

can you share a example , examples in the documentation were not helpful

Soorajkumar3 avatar Aug 15 '23 09:08 Soorajkumar3

Let's start with that example

from data_gradients.managers.segmentation_manager import SegmentationAnalysisManager 

train_data = ...
val_data = ...
class_names = ...

analyzer = SegmentationAnalysisManager(
    report_title="Testing Data-Gradients Segmentation",
    train_data=train_data,
    val_data=val_data,
    class_names=class_names,
)

analyzer.run()

What you need to have to use this script is:

  • training dataset/dataloader train_data
  • validation dataset/dataloader val_data
  • list of class names that appear in your dataset

This assumes that you already have a dataset/dataloader implementation (as explained in my previous comment). If you don't, then you have two options;

  • Either convert your data to COCO or VOC format. We provide built-in dataset formats for both types (Yolo format may come later but we don't support it currently)
  • Or build your own dataset class, which should iterate over your images/masks

Louis-Dupont avatar Aug 15 '23 11:08 Louis-Dupont