CoolFace
Datasetpublic

clallier/nesting-tasks-2d

Nesting Tasks Dataset for 2D Nesting Efficiency Estimation This is the official Hugging Face Hub version of the 2D Nesting Tasks Dataset originally published on Zenodo (DOI: 10.5281/zenodo.7030786), in 2022, during the my PhD research. πŸ‘₯ Authors & Affiliations Corentin Lallier (University of Bordeaux / @ Lectra) β€” πŸŽ“ Google Scholar | πŸ’Ό LinkedIn | πŸ’» GitHub | πŸ†” ORCID Laurent VΓ©zard (Data Science Manager @ Lectra) β€” πŸŽ“ Google Scholar | πŸ’Ό LinkedIn Bruno Pinaud… See the full description on the dataset page: https://huggingface.co/datasets/clallier/nesting-tasks-2d.

sourceHugging Facecc-by-4.0updated 4mo agoView on Hugging Face
0likes46downloads
Dataset Card

Nesting Tasks Dataset for 2D Nesting Efficiency Estimation

This is the official Hugging Face Hub version of the 2D Nesting Tasks Dataset originally published on Zenodo (DOI: 10.5281/zenodo.7030786), in 2022, during the my PhD research.

πŸ‘₯ Authors & Affiliations


This dataset is designed for training machine learning surrogate models (such as Graph Neural Networks) to estimate 2D irregular nesting efficiency (material utilization) without running computationally expensive operations research packing heuristics.


πŸ“‚ Dataset Summary

2D irregular cutting and packing (nesting) is a critical optimization problem in industries like textiles, apparel, and sheet-metal manufacturing. Traditionally, calculating the layout and material utilization of a set of irregular polygons requires running complex nesting heuristics, which can take seconds to minutes per run.

This dataset provides 100,000 unique nesting tasks containing high-level task descriptions, irregular polygon shapes, constraints, and target nesting efficiencies. This enables the training of neural networks to predict material utilization instantly, facilitating rapid layout evaluations.


🧬 Data Schema & Description

The dataset is divided into four modern, secure, and highly optimized Apache Parquet files:

1. tasks.parquet (Nesting high-level descriptors)

Contains global metrics and metadata for each nesting task.

ColumnTypeDescription
efficiencyfloatThe target label to predict. Given in percentage (%).
durationintegerNesting algorithm convergence time in seconds (s).
sheet_widthintegerWidth of the nesting area (unit: $m^{-4}$).
sheet_lengthintegerLength of the nesting area (unit: $m^{-4}$).
sheet_typeintegerSpecific nesting classification category.
tasks_indexintegerJoin key connecting tables across files.
is_train / is_val / is_testbooleanMasks indicating standard partitions for training, validation, and testing.

2. parts.parquet (Description of parts to be nested)

Describes the specific instances of parts allocated to each nesting task.

ColumnTypeDescription
tasks_indexintegerReference to tasks_index in the tasks file.
parts_idintegerUnique identifier for the part within its specific nesting task.
shape_hashintegerHash of the part's shape, serving as the join key to the shapes file.

3. shapes.parquet (Coordinate shapes of irregular polygons)

Detailed geometry coordinate boundaries for all irregular parts.

ColumnTypeDescription
shape_hashintegerUnique hash identifier of the shape geometry.
rawlist of integersAlternating sequence of $(x, y)$ coordinates defining the shape outline.
sizeslist of integersVertex sizes of any sub-shapes or inner boundaries.

4. constraints.parquet (Spacing, rotation, and alignment parameters)

Geometric spacing boundaries and physical placement constraints.

ColumnTypeDescription
typestringSpecific constraint category type identifier.
tasks_indexintegerReference to the nesting task tasks_index.
parts_1, parts_2list of integersPart IDs involved in the constraint.
p1_x, p1_y / p2_x, p2_ylist of floatsSpacing anchors and offset coordinates on each part.
r1_start, r1_end, r1_flip_xlist of floatsAllowed rotation range and flip settings.
y_min, y_maxlist of floatsAllowed positioning range on the $y$-axis.

πŸš€ How to Load and Explore the Dataset

πŸ” Exploring Directly on Hugging Face Data Studio / SQL Explorer

You can run SQL queries directly on your browser using DuckDB over the hosted Parquet tables:

  • β€”Query the train dataset split from tasks table
sql
    SELECT 
        tasks_index,
        duration,
        efficiency,
        sheet_width,
        sheet_length,
        sheet_type
    FROM tasks 
    WHERE is_train = true 
    LIMIT 500;
  • β€”Query parts and shapes geometry for a specific task:
sql
    SELECT 
        p.tasks_index,
        p.part_id,
        p.shape_hash,
        s.raw AS shape_vertices,
        s.sizes AS vertex_sizes
    FROM 
        parts p
    JOIN 
        shapes s ON p.shape_hash = s.shape_hash
    WHERE 
        p.tasks_index = 228
    ORDER BY 
        p.part_id ASC;
  • β€”Query constraints parameters for a specific task:
sql
    SELECT 
        tasks_index,
        type AS constraint_type,
        parts_1,
        parts_2,
        y_min,
        y_max,
        r1_start,
        r1_end,
        is_frozen
    FROM 
        constraints
    WHERE 
        tasks_index = 228;

πŸš€ Loading via the Hugging Face Datasets Library

You can also download or stream these relational tables directly from the Hugging Face Hub using their specific dataset configuration names:

python
from datasets import load_dataset

# Load individual tables using configuration subsets
tasks_ds = load_dataset("clallier/nesting-tasks-2d", name="tasks")
parts_ds = load_dataset("clallier/nesting-tasks-2d", name="parts")
shapes_ds = load_dataset("clallier/nesting-tasks-2d", name="shapes")
constraints_ds = load_dataset("clallier/nesting-tasks-2d", name="constraints")

print(tasks_ds)

πŸš€ Loading via Pandas

Since the dataset is stored in standard Apache Parquet format, loading takes a single line of python code:

python
import pandas as pd

# Load the high-level nesting tasks and labels
tasks_df = pd.read_parquet('tasks.parquet')

# Load corresponding geometric parts
parts_df = pd.read_parquet('parts.parquet')

# Load irregular polygon shape definitions
shapes_df = pd.read_parquet('shapes.parquet')

# Load spacing and alignment constraints
constraints_df = pd.read_parquet('constraints.parquet')

# Filter splits using the pre-defined boolean masks in tasks.parquet
train_df = tasks_df[tasks_df['is_train']]
val_df = tasks_df[tasks_df['is_val']]
test_df = tasks_df[tasks_df['is_test']]

print(f"Loaded {len(tasks_df)} irregular nesting tasks:")
print(f"   Train instances      : {len(train_df)}")
print(f"   Validation instances : {len(val_df)}")
print(f"   Test instances       : {len(test_df)}")

πŸ› οΈ Handling Missing Values (Nulls)

In the binary Apache Parquet format, missing optional parameters (such as unassigned x_offset or y_min values in constraints.parquet) are stored natively as `NULL` slots using Parquet's definition levels.

Different programming languages and frameworks load these binary NULLs into their own native type-safe representations:

  • β€”Python (Pandas):
  • β€”Native numerical columns (like x_offset of type float64) represent missing values as `NaN` (float representation).
  • β€”Object or list columns (like y_min of type object) represent missing values as `None`.
  • β€”Tip: You can check for both formats simultaneously using a single call to df.isna() or df.isnull().
  • β€”Rust (Polars / Arrow):
  • β€”Parsed directly into native, type-safe optional wrappers: `Option<f64>` for float parameters and `Option<Vec<f64>>` for geometric coordinate lists.
  • β€”C++ (Arrow):
  • β€”Represented as null slots in the Arrow array validity bitmap (IsValid(index) == false).

πŸ“œ Citation & Credits

If you use this dataset in your research or industrial applications, please cite the original Zenodo record:

bibtex
@dataset{lallier2022nesting,
  author       = {Lallier, Corentin and V{\'e}zard, Laurent and Pinaud, Bruno and Blin, Guillaume},
  title        = {Nesting tasks dataset for 2d-nesting efficiency estimation},
  month        = aug,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {1.1.0},
  doi          = {10.5281/zenodo.7030786},
  url          = {https://doi.org/10.5281/zenodo.7030786}
}