Instructions to use pakiino/sketch2stl-recognizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use pakiino/sketch2stl-recognizer with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("pakiino/sketch2stl-recognizer", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
sketch2stl · stroke recogniser (ML1)
Classifies one hand-drawn stroke as line, arc, circle, rect or polyline for the sketch2stl app
(draw a 2-D shape → printable STL). Trained from scratch: HistGradientBoostingClassifier over 12
geometric features (sketch2stl.recognizer.features).
Training data
14,608 synthetic hand-drawn strokes (ML1_stroke_recognizer/synthetic_mouse in the dataset): clean
Fusion 360 Gallery CAD curves re-drawn by the repo's hand model (sketch2stl.data.synth, style mouse,
per-class tremor). Split by CAD model with the official train_test.json; 3,000 held-out test strokes.
Evaluation
| test set | n | rules macro-F1 | ML1 macro-F1 | ML1 accuracy |
|---|---|---|---|---|
| synthetic, held-out CAD models | 3000 | 0.745 | 0.964 | 0.964 |
| real hand-drawn (PK, mouse, never trained on) | 325 | 0.869* | 0.765 | 0.785 |
Per-class F1 on real strokes: line 0.99 · arc 0.98 · circle 0.79 · rect 0.70 · polyline 0.36
*The rules' thresholds and the hand model's tremor levels were calibrated on these same 325 real strokes, so the real-stroke numbers are optimistic for the rules and somewhat for ML1 too.
Main failure on real strokes: hand-drawn polylines are often read as rectangles.
In the app
The app wraps this model in HybridRecognizer (sketch2stl/recognizer/hybrid.py): ML1 decides line / arc /
closed shape, and among closed shapes the least-squares circle / rectangle fits win where they disagree
(a circle only if the stroke has at most one sharp corner). On the 325 real strokes that reaches macro-F1
0.91 - an app-quality number, not a held-out score, for the reason above.
Licence
Derived from the Fusion 360 Gallery Dataset (Autodesk) — non-commercial research use only.
- Downloads last month
- -