--- license: mit tags: - line-segment-detection - deeplsd - image-features --- # DeepLSD — weight mirror Unmodified mirror of the two checkpoints published for [DeepLSD](https://github.com/cvg/DeepLSD) (CVPR 2023, Pautrat et al.), a hybrid line segment detector: a network predicts a line distance and angle field, and a modified LSD reads the segments off those predicted fields instead of off the image gradient. Upstream ships no Hugging Face repo and serves these files from a university web server. This repo exists so they can be fetched with `huggingface_hub` and loaded offline afterwards. **Nothing here is retrained, converted or quantised** — the files are byte-identical to the upstream artefacts listed below. (They are `torch.save` archives despite the `.tar` extension, which is upstream's naming.) ## Contents | File | Bytes | SHA-256 | |------|------:|---------| | `deeplsd_md.tar` | 102,898,193 | `56e9bae263977caa289ae49802987a67d4f00f376ae7e542176c8ae0a6cc2083` | | `deeplsd_wireframe.tar` | 102,898,321 | `6d0c1bc78f79eb9e564404e4fef797d12ab18f30ba596208cca16116c2429406` | ## Which one to use | File | Trained on / suited to | |------|------------------------| | `deeplsd_md.tar` | Trained on MegaDepth. The generic checkpoint: outdoor scenes and harder images (night, fog, blur). Upstream's own demo default. | | `deeplsd_wireframe.tar` | Trained on the Wireframe dataset. Clean man-made scenes -- documents, floorplans, CAD exports, indoor rooms. | ## Provenance | File | Upstream source | |------|-----------------| | `deeplsd_md.tar` | `https://cvg-data.inf.ethz.ch/DeepLSD/deeplsd_md.tar` | | `deeplsd_wireframe.tar` | `https://cvg-data.inf.ethz.ch/DeepLSD/deeplsd_wireframe.tar` | Each file was verified before upload by loading it into DeepLSD's own network and requiring an exact fit — zero missing and zero unexpected `state_dict` keys. ## Usage ```python import torch from huggingface_hub import hf_hub_download # DeepLSD ships no pip package; see the upstream repo for the model definition. from deeplsd.models.deeplsd_inference import DeepLSD path = hf_hub_download("xboix/deeplsd", "deeplsd_md.tar") net = DeepLSD({"detect_lines": True}) net.load_state_dict(torch.load(path, map_location="cpu")["model"]) net = net.eval() ``` ## Citation ```bibtex @InProceedings{pautrat_suarez_2023_deeplsd, title={DeepLSD: Line Segment Detection and Refinement with Deep Image Gradients}, author={Pautrat, R{\'e}mi and Barath, Daniel and Larsson, Viktor and Oswald, Martin R. and Pollefeys, Marc}, booktitle={Computer Vision and Pattern Recognition (CVPR)}, year={2023}, } ```