GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vitaliy-hnatyk/sketch2schematic-ai: Browser-first AI tool that converts hand-drawn or uploaded electrical diagrams into editable schematics with React, PixiJS, ONNX, OpenCV/WASM, Tesseract, and circuit-graph reconstruction.

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
docs
docs
 
 
models
models
 
 
public
public
 
 
samples
samples
 
 
scripts
scripts
 
 
src
src
 
 
tessdata
tessdata
 
 
training
training
 
 
wasm-core
wasm-core
 
 
.editorconfig
.editorconfig
 
 
.env.example
.env.example
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.nvmrc
.nvmrc
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CITATION.cff
CITATION.cff
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
MODEL_TRAINING.md
MODEL_TRAINING.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
SUPPORT.md
SUPPORT.md
 
 
THIRD_PARTY_NOTICES.md
THIRD_PARTY_NOTICES.md
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
structured-iec-result.png
structured-iec-result.png
 
 
verified-current-result.png
verified-current-result.png
 
 
vite.config.js
vite.config.js
 
 

Repository files navigation

Sketch2Schematic AI

Browser-first electrical schematic recognition and editing with React, PixiJS, ONNX Runtime Web, OpenCV/WASM, Tesseract, and circuit-graph reconstruction.

Sketch2Schematic AI preview

What it does

Sketch2Schematic AI converts uploaded circuit images or mouse/pen drawings into an editable schematic. The result is rendered with PixiJS and can be panned, zoomed, corrected, relabeled, and exported.

The recognition pipeline combines:

  • a fast bundled heuristic/WASM recognizer;
  • optional YOLO component detection through ONNX Runtime Web;
  • adaptive OpenCV wire extraction;
  • optional Tesseract OCR for references and values;
  • circuit-graph cleanup and port/net reconstruction.

A trained circuit-yolo.onnx model is not included. Without one, the application uses the bundled heuristic recognizers and optional OpenCV/OCR stages.

Version 7.2 performance update

Recognition now starts in Fast mode.

  • Uploaded images are processed at a smaller safe working resolution.
  • Tesseract OCR is disabled by default because it is normally the slowest first-run stage.
  • OpenCV is skipped when the fallback recognizer has already found enough wires.
  • YOLO and OpenCV can run concurrently.
  • YOLO, OpenCV, and OCR results are cached for repeated analysis of the same image.
  • Fixed-shape ONNX models still use their required input dimensions.
  • The status bar reports the total recognition time.

Available profiles:

Profile Image preprocessing OCR Intended use
Fast up to 850 px off by default normal clean schematics
Balanced up to 1100 px optional rough or medium-quality images
Accurate up to 1400 px optional difficult, noisy, or low-resolution images

See Performance and recognition speed for details.

Quick start

Requirements: Node.js 20+ and npm 10+.

npm install
npm run dev

Open the local URL shown by Vite.

Production build:

npm run build
npm run serve:dist

Add a YOLO ONNX model

Place these files in public/models/:

public/models/circuit-yolo.onnx
public/models/labels.json

They can also be selected from the AI recognition panel at runtime.

Training helpers are available under training/. The expected model format is documented in docs/model-contract.md.

Train your own circuit detector

A complete end-to-end guide is included for preparing a YOLO-format dataset, checking annotations, training, validating, exporting ONNX, and running the model in the browser.

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\Activate.ps1
python -m pip install -r training/requirements.txt

npm run model:check-data
npm run model:train
npm run model:validate
npm run model:export
npm run dev

Start with MODEL_TRAINING.md, then use the detailed model training guide.

Commands

npm run dev                 # development server
npm run build               # production build
npm run check               # all CI tests and production build
npm run test:performance    # performance-profile wiring test
npm run test:recognizer     # vector recognizer regression test
npm run test:iec            # IEC classifier regression test
npm run serve:dist          # serve the production build
npm run model:check-data     # validate YOLO dataset files and labels
npm run model:train          # train the detector
npm run model:validate       # evaluate best.pt
npm run model:export         # export/install ONNX and labels.json

Repository structure

src/
  ai/             ONNX, OpenCV, OCR, and pipeline integration
  components/     React interface and PixiJS editor components
  config/         application metadata and performance profiles
  utils/          heuristic recognition, graph cleanup, and exports
  wasm/           bundled recognition WebAssembly
  workers/        background image-recognition worker
public/
  models/         optional ONNX model and labels
  samples/        sample circuit images
  tessdata/       local OCR language data
docs/             architecture and operation documentation
training/         YOLO training/export helpers
scripts/          tests, build helpers, and repository tools

Documentation

  • Documentation index
  • Architecture
  • AI pipeline
  • Performance
  • Recognition settings
  • Model contract
  • Model training
  • Model training quick start
  • Circuit graph
  • Deployment
  • Troubleshooting

Privacy

Recognition runs locally in the browser. Uploaded images are not sent to a project-controlled server. A deployment can still introduce third-party hosting or analytics, so review its configuration before publishing.

Contributing and security

Read CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md before opening a contribution or reporting a vulnerability.

License

MIT. See LICENSE and THIRD_PARTY_NOTICES.md.

Version 7.5 engine isolation

The application now has four output modes:

  • Hybrid — merge enabled engines with the heuristic fallback;
  • Heuristic/WASM only — baseline symbols and wires;
  • YOLO-only components — only YOLO supplies component symbols; heuristic wires remain;
  • OCR-only labels — Tesseract only attaches references and values to heuristic symbols.

YOLO-only refuses to run without a trained ONNX model, so a missing model can no longer silently look like the heuristic result. OCR-only explicitly reports how many words were found and how many component labels/values were attached.

See engine comparison.

About

Browser-first AI tool that converts hand-drawn or uploaded electrical diagrams into editable schematics with React, PixiJS, ONNX, OpenCV/WASM, Tesseract, and circuit-graph reconstruction.

Topics

browser-aicircuit-diagramcircuit-recognitioncomputer-visiondiagram-editorelectrical-engineeringelectronicsmachine-learningocronnxonnxruntimeopencvschematicschematic-editortesseractwebassemblywebgpuyolo

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.