Download training/README.md from pashaalex/ecg-rectifier: direct link, hf CLI and curl.
- Browser
- Download file 2.81 kB
-
https://huggingface.co/pashaalex/ecg-rectifier/resolve/main/training/README.md
- Command line
-
hf download hf://pashaalex/ecg-rectifier/training/README.md
-
curl -L -o README.md https://huggingface.co/pashaalex/ecg-rectifier/resolve/main/training/README.md
Training
Synthetic data generators and training scripts of the four networks in ../models. Data and
checkpoints go through Hugging Face repos (HUB_REPO_ID, DATASET_REPO, MODEL_REPO); the generators
run on CPU, the window networks and the mask need a CUDA GPU.
| model | data | train |
|---|---|---|
offsets.onnx |
VERSION=v3 python3 build_canvases.py (10 000 + 1 000 + 1 000 canvases) |
train_offsets.py (200 epochs), then export_onnx.py offsets |
detector.onnx |
VERSION=v5 python3 build_canvases.py (12 000 + 1 000 + 1 000 canvases) |
train_detector.py (156 epochs), then export_onnx.py detector |
mask.onnx |
python3 build_masks.py (6 000 + 500 pages) |
train_mask.py (40 epochs, exports ONNX) |
lattice.onnx |
generated on the fly (lattice_points.py) |
train_lattice.py (30 000 steps, exports ONNX) |
Setup:
pip install -r requirements.txt
make -C renderer # C++ renderer -> renderer/mesh_render.so (Linux)
The renderer is MeshAugmentor. Instead of building it,
take the prebuilt library from its release 0.1.0
and put the files from mesh_augmentor/_lib/ into renderer/: mesh_render.so (Linux) or
mesh_render.dll with the three MinGW runtime DLLs next to it (Windows).
The seeds, sizes and hyper-parameters are those of the published models. The published models were trained on an earlier version of these generators that drew ECG traces from recorded ECGs and used another hand-writing font; everything else is unchanged. Bitwise reproducibility of GPU training is not expected.
Files
renderer/β C++ ray-tracing mesh renderer from MeshAugmentor (thin lens, distortion, disk light, shadows) and its ctypes binding.sheet_geometry.pyβ developable sheet: profile curve with cylinder / wave / ridge / crease / curl / fold components.ecg_synth.pyβ synthetic 12-lead ECG (five Gaussian waves per lead, no data files).ecg_paper.pyβ flat ECG sheet texture (grids, paper, ECG traces, text, stains).scene.pyβ sheet + camera + renderer + photometry -> photo, mask, uv;shadows.pyβ sharp shadows (v5).canvas.py,build_canvases.pyβ 320 x 320 training canvases with dense paper-coordinate labels.crops.pyβ 224 x 224 windows and patch labels;common.pyβ shared training code.detector_data.pyβ node ground truth, occlusions and CenterNet targets for the detector.mask_page.py,mask_backgrounds.py,mask_scene.py,build_masks.pyβ whole-page photos with sheet / signal labels.lattice_points.pyβ synthetic corrupted node sets for the lattice GNN.fonts/β DejaVu Sans Mono and Caveat (hand-writing), with their licences.