This repository contains the official implementation for DT-LSD (Deformable Transformer-based Line Segment Detector)
- Training
- Evaluation
- Upload source code
- Upload weight
- Inference
- Upload arxiv paper
- We have released a new model called LINEA.
- LINEA presents a new attention mechanism called line attention.
- LINEA has four model sizes: n, s, and l.
- Try LINEA hugging face space
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.
git clone https://github.com/SebastianJanampa/DTLSD.git cd DTLSD
-
Install Pytorch and torchvision
Follow the instructions on https://pytorch.org/get-started/locally/.
# an example: conda install -c pytorch pytorch torchvision
-
Install other needed packages
pip install -r requirements.txt
-
Compiling CUDA operators
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.
- Training
bash scripts/train/DTLSD_SWIN_4_scales_24_epochs.sh
- Testing
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}
}