GMUSketchCleanup

GMUSketchCleanup is a SketchDataset loader for the GMU Rough Sketch Cleanup benchmark. The dataset provides paired GT (clean) and Rough sketches in SVG format and is primarily used for research on sketch cleaning, vectorization and stroke refinement. The loader parses SVG outlines into Sketch objects composed of Paths and cubic Bézier Curves.

Source: datasets/gmu_sketch_cleanup.py

Data Format

  • Raw files are standard SVG drawings where strokes are represented as path elements. Only cubic Bézier (C/c) and line segments are supported; arcs and basic shapes (rect/circle/ellipse/line/polyline/polygon) are ignored or rejected.

  • Each path is converted into one or more strokes, each stroke represented by a sequence of cubic Bézier control points. Lines are automatically converted to equivalent cubic curves.

  • The loader returns a Sketch object with:

    • paths: a list of Path instances containing Curves.

    • width, height: canvas dimensions extracted from the SVG viewBox or width/height attributes.

Directory Layout

After download and extraction the cache directory should look like::

<root>/                            # default root provided by user
  Benchmark_Dataset/
    GT/                            # clean ground-truth SVGs
      *.svg
    Rough/
      SVG/                         # rough sketches
        *.svg
      JPG/                         # optional raster previews
      PNG/
    sketch_tags.csv               # metadata (optional columns)
  .metadata.parquet               # generated by the loader
  • Only the id column in the CSV/metadata is mandatory; additional columns such as split (GT/Rough) and file_path may be present. The loader rebuilds .metadata.parquet if it is missing or its columns do not match the declared metadata fields.

Code

from sketchkit.datasets import GMUSketchCleanup

ds = GMUSketchCleanup(
    load_all=False,  # set True to load everything into memory
    cislab_source=True
)

gt_rows = ds.items_metadata[
    ds.items_metadata["split"] == "GT"
]  # split can also be "Rough" for rough sketches
idx = int(gt_rows.iloc[0]["id"])
sketch = ds[idx]
print(sketch.width, sketch.height)
print(sketch.path_num, sketch.curve_num)

Arguments

  • cislab_source: Selects the download source. If True, the dataset is downloaded from the CISLAB CDN mirror; otherwise it is downloaded from official host.

    • CISLAB mirror: https://cislab.hkust-gz.edu.cn/projects/sketchkit/datasets/GMUSketchCleanup/Benchmark_Dataset.zip

    • Official host: https://cragl.cs.gmu.edu/sketchbench/Benchmark_Dataset.zip