Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- line-segment-detection
|
| 5 |
+
- deeplsd
|
| 6 |
+
- image-features
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# DeepLSD — weight mirror
|
| 10 |
+
|
| 11 |
+
Unmodified mirror of the two checkpoints published for
|
| 12 |
+
[DeepLSD](https://github.com/cvg/DeepLSD) (CVPR 2023, Pautrat et al.), a hybrid line segment
|
| 13 |
+
detector: a network predicts a line distance and angle field, and a modified LSD reads the
|
| 14 |
+
segments off those predicted fields instead of off the image gradient.
|
| 15 |
+
|
| 16 |
+
Upstream ships no Hugging Face repo and serves these files from a university web server. This
|
| 17 |
+
repo exists so they can be fetched with `huggingface_hub` and loaded offline afterwards.
|
| 18 |
+
|
| 19 |
+
**Nothing here is retrained, converted or quantised** — the files are byte-identical to the
|
| 20 |
+
upstream artefacts listed below. (They are `torch.save` archives despite the `.tar` extension,
|
| 21 |
+
which is upstream's naming.)
|
| 22 |
+
|
| 23 |
+
## Contents
|
| 24 |
+
|
| 25 |
+
| File | Bytes | SHA-256 |
|
| 26 |
+
|------|------:|---------|
|
| 27 |
+
| `deeplsd_md.tar` | 102,898,193 | `56e9bae263977caa289ae49802987a67d4f00f376ae7e542176c8ae0a6cc2083` |
|
| 28 |
+
| `deeplsd_wireframe.tar` | 102,898,321 | `6d0c1bc78f79eb9e564404e4fef797d12ab18f30ba596208cca16116c2429406` |
|
| 29 |
+
|
| 30 |
+
## Which one to use
|
| 31 |
+
|
| 32 |
+
| File | Trained on / suited to |
|
| 33 |
+
|------|------------------------|
|
| 34 |
+
| `deeplsd_md.tar` | Trained on MegaDepth. The generic checkpoint: outdoor scenes and harder images (night, fog, blur). Upstream's own demo default. |
|
| 35 |
+
| `deeplsd_wireframe.tar` | Trained on the Wireframe dataset. Clean man-made scenes -- documents, floorplans, CAD exports, indoor rooms. |
|
| 36 |
+
|
| 37 |
+
## Provenance
|
| 38 |
+
|
| 39 |
+
| File | Upstream source |
|
| 40 |
+
|------|-----------------|
|
| 41 |
+
| `deeplsd_md.tar` | `https://cvg-data.inf.ethz.ch/DeepLSD/deeplsd_md.tar` |
|
| 42 |
+
| `deeplsd_wireframe.tar` | `https://cvg-data.inf.ethz.ch/DeepLSD/deeplsd_wireframe.tar` |
|
| 43 |
+
|
| 44 |
+
Each file was verified before upload by loading it into DeepLSD's own network and requiring an
|
| 45 |
+
exact fit — zero missing and zero unexpected `state_dict` keys.
|
| 46 |
+
|
| 47 |
+
## Usage
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
import torch
|
| 51 |
+
from huggingface_hub import hf_hub_download
|
| 52 |
+
|
| 53 |
+
# DeepLSD ships no pip package; see the upstream repo for the model definition.
|
| 54 |
+
from deeplsd.models.deeplsd_inference import DeepLSD
|
| 55 |
+
|
| 56 |
+
path = hf_hub_download("xboix/deeplsd", "deeplsd_md.tar")
|
| 57 |
+
net = DeepLSD({"detect_lines": True})
|
| 58 |
+
net.load_state_dict(torch.load(path, map_location="cpu")["model"])
|
| 59 |
+
net = net.eval()
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Citation
|
| 63 |
+
|
| 64 |
+
```bibtex
|
| 65 |
+
@InProceedings{pautrat_suarez_2023_deeplsd,
|
| 66 |
+
title={DeepLSD: Line Segment Detection and Refinement with Deep Image Gradients},
|
| 67 |
+
author={Pautrat, R{\'e}mi and Barath, Daniel and Larsson, Viktor and Oswald, Martin R. and Pollefeys, Marc},
|
| 68 |
+
booktitle={Computer Vision and Pattern Recognition (CVPR)},
|
| 69 |
+
year={2023},
|
| 70 |
+
}
|
| 71 |
+
```
|