This repository contains the official implementation for DT-LSD (Deformable Transformer-based Line Segment Detector)



| Dataset | sAP10 | sAP15 | APH | FH | FPS |
|---|---|---|---|---|---|
| Wireframe | 71.7 | 73.9 | 89.1 | 85.8 | 8.9 |
| YorkUrban | 33.2 | 35.1 | 65.9 | 68.0 | 8.9 |
Clone this repository.
sh
git clone https://github.com/SebastianJanampa/DTLSD.git
cd DTLSD
Install Pytorch and torchvision
Follow the instructions on https://pytorch.org/get-started/locally/.
sh
# an example:
conda install -c pytorch pytorch torchvision
Install other needed packages
sh
pip install -r requirements.txt
Compiling CUDA operators
sh
cd models/dtlsd/ops
python setup.py build install
# unit test (should see all checking is True)
python test.py
cd ../../..
To reproduce our results, you need to process two datasets, ShanghaiTech and YorkUrban.
mkdir data
cd data
wget https://github.com/SebastianJanampa/storage/releases/download/v1.0.0/wireframe_processed.zip
wget https://github.com/SebastianJanampa/storage/releases/download/v1.0.0/york_processed.zip
unzip wireframe_processed.zip
unzip york_processed.zip
rm *zip
cd ..
Download the weights from DINO_SWIN_4scales_36_epochs from the DINO repo, and place it in the pretrain folder.
bash scripts/train/DTLSD_SWIN_4_scales_24_epochs.sh
bash scripts/train/DTLSD_SWIN_4_scales_24_epochs.sh
Download the DTLSD weights
wget https://github.com/SebastianJanampa/storage/releases/download/v1.0.0/DTLSD_checkpoint0035.pth
If wget doesn't work, download it from this link, and place it in the main folder. Then run
python demo.py
@InProceedings{Janampa_2025_WACV,
author = {Janampa, Sebastian and Pattichis, Marios},
title = {DT-LSD: Deformable Transformer-Based Line Segment Detection},
booktitle = {Proceedings of the Winter Conference on Applications of Computer Vision (WACV)},
month = {February},
year = {2025},
pages = {3477-3486}
}
$ claude mcp add DT-LSD \
-- python -m otcore.mcp_server <graph>