Skip to content

MarkJoson/DT-LSD

 
 

Repository files navigation

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

  • Training
  • Evaluation
  • Upload source code
  • Upload weight
  • Inference
  • Upload arxiv paper

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.

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

    # an example:
    conda install -c pytorch pytorch torchvision
  3. Install other needed packages

    pip install -r requirements.txt
  4. Compiling CUDA operators

    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

@article{janampa2024dt,
  title={DT-LSD: Deformable Transformer-based Line Segment Detection},
  author={Janampa, Sebastian and Pattichis, Marios},
  journal={arXiv preprint arXiv:2411.13005},
  year={2024}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.7%
  • Cuda 11.4%
  • Shell 3.7%
  • C++ 1.1%
  • MATLAB 1.1%