MCPcopy Index your code
hub / github.com/SebastianJanampa/DT-LSD

github.com/SebastianJanampa/DT-LSD @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
622 symbols 1,812 edges 70 files 119 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

arXiv

DT-LSD: Deformable Transformer-based Line Segment Detection

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

Model Architecture

TODO

  • [x] Training
  • [x] Evaluation
  • [x] Upload source code
  • [x] Upload weight
  • [x] Inference
  • [x] Upload arxiv paper

🚀 Updates

  • 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

Results

sap_wireframe aph_wireframe

sap_york aph_york

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

Installation

  1. Clone this repository. sh git clone https://github.com/SebastianJanampa/DTLSD.git cd DTLSD

  2. Install Pytorch and torchvision

Follow the instructions on https://pytorch.org/get-started/locally/. sh # an example: conda install -c pytorch pytorch torchvision

  1. Install other needed packages sh pip install -r requirements.txt

  2. 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 ../../..

Dataset

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 ..

Pretraining weights

Download the weights from DINO_SWIN_4scales_36_epochs from the DINO repo, and place it in the pretrain folder.

Run

  1. Training
bash scripts/train/DTLSD_SWIN_4_scales_24_epochs.sh 
  1. Testing
bash scripts/train/DTLSD_SWIN_4_scales_24_epochs.sh

Demo

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

Citation

@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}
}

Core symbols most depended-on inside this repo

append
called by 121
evaluation/lcnn/box.py
print
called by 79
util/misc.py
items
called by 55
evaluation/lcnn/box.py
to
called by 41
util/misc.py
max
called by 36
util/misc.py
update
called by 33
util/utils.py
pop
called by 23
evaluation/lcnn/box.py
float
called by 20
evaluation/lcnn/box.py

Shape

Method 355
Function 177
Class 90

Languages

Python99%
C++1%

Modules by API surface

evaluation/lcnn/box.py86 symbols
util/misc.py51 symbols
datasets/transforms.py50 symbols
util/utils.py46 symbols
util/slconfig.py33 symbols
models/dtlsd/deformable_transformer.py28 symbols
models/dtlsd/swin_transformer.py27 symbols
util/slio.py23 symbols
models/dtlsd/dtlsd.py20 symbols
evaluation/lcnn/trainer.py17 symbols
demo.py17 symbols
evaluation/lcnn/models/hourglass_pose.py15 symbols

For agents

$ claude mcp add DT-LSD \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page