Update README.md
Browse files
README.md
CHANGED
|
@@ -5,6 +5,34 @@ tags:
|
|
| 5 |
- image-segmentation
|
| 6 |
- historical-maps
|
| 7 |
- cartography
|
|
|
|
| 8 |
library_name: pytorch
|
| 9 |
---
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
- image-segmentation
|
| 6 |
- historical-maps
|
| 7 |
- cartography
|
| 8 |
+
- vectorization
|
| 9 |
library_name: pytorch
|
| 10 |
---
|
| 11 |
|
| 12 |
+
|
| 13 |
+
# Building Block Vectorization in Historical Maps
|
| 14 |
+
|
| 15 |
+
Polygon extraction of building blocks from historical maps of Paris. Trained as part of the course [Research Topics in Cartography](https://karto.ethz.ch/en/education/courses/master/research-topics-cartography.html) at ETH Zurich (Spring 2026). Source code: [github.com/dav1dclara/cartography-research](https://github.com/dav1dclara/cartography-research).
|
| 16 |
+
|
| 17 |
+
## Models
|
| 18 |
+
|
| 19 |
+
Single-class binary segmentation of building blocks ("block"). Each subfolder contains one `model_f{N}.safetensors` per cross-validation fold plus a shared `config.json` carrying model configuration, class names, per-fold and ensemble decision thresholds, normalization mode, recommended sliding-window patch size (512), and number of folds.
|
| 20 |
+
|
| 21 |
+
| Subfolder | Architecture | Encoder | Folds |
|
| 22 |
+
|---|---|---|---|
|
| 23 |
+
| `unet_scse` | U-Net + SCSE attention | EfficientNet-B3 | 2 |
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
pip install torch segmentation-models-pytorch safetensors huggingface_hub pillow numpy
|
| 29 |
+
|
| 30 |
+
python inference.py \
|
| 31 |
+
--hf-repo davidclara/building-block-vectorization \
|
| 32 |
+
--model-name unet_scse \
|
| 33 |
+
--image map.jpg \
|
| 34 |
+
--out mask.png
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
`inference.py` is a minimal example: Gaussian-weighted sliding-window prediction with `stride = patch_size // 2`, normalization driven by `config.json` (`simple` = `/255`, `imagenet` = mean/std), sigmoid averaged across folds per patch, thresholding with the ensemble threshold, and writing a single binary PNG mask. For the full training and inference pipeline see the [GitHub repository](https://github.com/dav1dclara/cartography-research).
|
| 38 |
+
|