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
Sketchobject with:paths: a list ofPathinstances containingCurves.width,height: canvas dimensions extracted from the SVGviewBoxorwidth/heightattributes.
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
idcolumn in the CSV/metadata is mandatory; additional columns such assplit(GT/Rough) andfile_pathmay be present. The loader rebuilds.metadata.parquetif 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. IfTrue, 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.zipOfficial host:
https://cragl.cs.gmu.edu/sketchbench/Benchmark_Dataset.zip