CoolFace
Datasetpublic

twarner/dcode-imagenet-sketch

dcode: ImageNet-Sketch to G-code Dataset A dataset of ImageNet-Sketch images paired with generated G-code for training text-to-gcode diffusion models. Overview This dataset enables training models that convert text descriptions directly into G-code for CNC machines, plotters, and polargraph drawing robots. Feature Value Source Images ImageNet-Sketch Classes 1,000 ImageNet categories Images ~50,000 black/white sketches G-code Files ~200,000 (4… See the full description on the dataset page: https://huggingface.co/datasets/twarner/dcode-imagenet-sketch.

sourceHugging Facemitupdated 9mo agoView on Hugging Face
0likes84downloads
Dataset Card

dcode: ImageNet-Sketch to G-code Dataset

A dataset of ImageNet-Sketch images paired with generated G-code for training text-to-gcode diffusion models.

Overview

This dataset enables training models that convert text descriptions directly into G-code for CNC machines, plotters, and polargraph drawing robots.

FeatureValue
Source ImagesImageNet-Sketch
Classes1,000 ImageNet categories
Images~50,000 black/white sketches
G-code Files~200,000 (4 algorithms × images)
Algorithmsspiral, crosshatch, squares, trace

Structure

images/
    n01440764/              # ImageNet synset ID
        ILSVRC2012_val_00000293.JPEG
        ...
    n01443537/
        ...
gcode/
    n01440764/
        spiral/
            ILSVRC2012_val_00000293_spiral_0.gcode
            ILSVRC2012_val_00000293_spiral_1.gcode
        crosshatch/
            ...
        squares/
            ...
        trace/
            ...

Algorithms

AlgorithmDescription
spiralConcentric spiral from center, density varies with brightness
crosshatchMulti-angle hatching lines at configurable angles
squaresConcentric squares sized by local brightness
traceBinary edge detection with scan-line tracing

Usage

python
from datasets import load_dataset

# Load the dataset
ds = load_dataset("twarner/dcode-imagenet-sketch")

# Access image and corresponding gcode
sample = ds["train"][0]
print(sample["image_path"])
print(sample["gcode_path"])
print(sample["caption"])  # "a sketch of a goldfish"

Training

This dataset was used to train dcode-sd-gcode-v3, an end-to-end text-to-gcode diffusion model.

Project

Full project documentation, hardware build guide, and interactive demo:

🔗 [teddywarner.org/Projects/Polargraph/#dcode](https://teddywarner.org/Projects/Polargraph/#dcode)

Citation

bibtex
@misc{dcode2024,
  author = {Teddy Warner},
  title = {dcode: Text-to-Gcode Diffusion Model},
  year = {2026},
  url = {https://teddywarner.org/Projects/Polargraph/#dcode}
}

License

MIT License