View source Download .ipynb

Create Table from YOLO Instance Segmentation¶

Create a 3LC Table from YOLO-format dataset with polygon-based instance segmentation annotations for modern object detection pipelines.

img

YOLO format is widely used in modern computer vision pipelines due to its simplicity and efficiency. The polygon-based segmentation format provides precise boundaries while maintaining fast inference speeds.

This notebook loads a YOLO-format segmentation dataset and converts it to a 3LC Table. We process both image files and corresponding text annotation files containing normalized polygon coordinates for each instance.

Project setup¶

[ ]:
PROJECT_NAME = "3LC Tutorials - YOLO Segmentation"
DATASET_NAME = "YOLO-Seg-Dataset"
TABLE_NAME = "initial-segmentation"
DATA_PATH = "../../../data"

Install dependencies¶

[ ]:
%pip install 3lc

Imports¶

[ ]:
from pathlib import Path

import tlc

Create Segmentation Table¶

[ ]:
dataset_yaml_file = (Path(DATA_PATH) / "yolo" / "simple.yaml").absolute()

assert dataset_yaml_file.exists()

train_table = tlc.Table.from_yolo(
    dataset_yaml_file=str(dataset_yaml_file),
    split="train",
    project_name=PROJECT_NAME,
    dataset_name=DATASET_NAME,
    table_name=TABLE_NAME,
    task="segment",
)