|
|
--- |
|
|
license: mit |
|
|
task_categories: |
|
|
- text-to-image |
|
|
- image-to-text |
|
|
language: |
|
|
- en |
|
|
tags: |
|
|
- gcode |
|
|
- cnc |
|
|
- plotter |
|
|
- polargraph |
|
|
- line-art |
|
|
- sketch |
|
|
- stable-diffusion |
|
|
size_categories: |
|
|
- 100K<n<1M |
|
|
--- |
|
|
|
|
|
# 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](https://github.com/HaohanWang/ImageNet-Sketch) | |
|
|
| Classes | 1,000 ImageNet categories | |
|
|
| Images | ~50,000 black/white sketches | |
|
|
| G-code Files | ~200,000 (4 algorithms × images) | |
|
|
| Algorithms | spiral, 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 |
|
|
|
|
|
| Algorithm | Description | |
|
|
|-----------|-------------| |
|
|
| **spiral** | Concentric spiral from center, density varies with brightness | |
|
|
| **crosshatch** | Multi-angle hatching lines at configurable angles | |
|
|
| **squares** | Concentric squares sized by local brightness | |
|
|
| **trace** | Binary 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](https://huggingface.co/twarner/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 |
|
|
|