Skip to content

lh9171338/ULSD-ISPRS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ULSD-ISPRS

This repository contains the official PyTorch implementation of the paper: ULSD: Unified Line Segment Detection across Pinhole, Fisheye, and Spherical Cameras.

Introduction

ULSD is a unified line segment detection method for both distorted and undistorted images from pinhole, fisheye or spherical cameras. With a novel line segment representation based on the Bezier curve, our method can detect arbitrarily distorted line segments. Experimental results on the pinhole, fisheye, and spherical image datasets validate the superiority of the proposed ULSD to the SOTA methods both in accuracy and efficiency. Especially, the performance of ULSD trained on the three-mixed dataset further demonstrates its effectiveness and generality across the three common camera model.

Network Architecture

Results

Quantitative Comparisons

Method Training Dataset Mixed Dataset FPS
sAP5 sAP10 sAP15 msAP mAPJ
HT - 0.9 1.7 2.5 1.7 6.1 0.3
L-CNN P 46.7 49.9 51.4 49.3 50.6 13.4
HAWP P 50.3 53.3 54.8 52.8 50.4 32.0
ULSD (Ours) P 50.8 54.6 56.4 53.9 60.6 37.0
ULSD (Ours) P+F+S 63.0 67.2 69.1 66.4 61.6 36.9

Qualitative Comparisons

Requirements

  • python3
  • pytorch==1.6.0
  • CUDA==10.1
  • opencv, numpy, scipy, matplotlib, argparse, yacs, tqdm, json, multiprocessing, sklearn, tensorboardX

Step-by-step installation

conda create --name ulsd python=3.7
conda activate ulsd

cd <ulsd-path>
git clone https://github.com/lh9171338/ULSD-ISPRS.git
cd ULSD-ISPRS

pip install -r requirements.txt
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1 -c pytorch

Quickstart with the pretrained model

  • There are 4 pretrained models (mixed.pkl, pinhole.pkl, fisheye.pkl, and spherical.pkl) in Google drive or Baiduyun . Please download them and put in the model/ folder.
  • Put your test images in the dataset/ folder.
python test.py --dataset_name <DATASET_NAME> --order 4 --model_name <MODEL_NAME> --save_image
  • The results are saved in the output/ folder.

Training & Testing

Data Preparation

  • Download the json-format dataset from Google Drive.
  • Unzip the dataset to the dataset/ folder.
  • Convert the dataset from json-format to npz-format.
cd dataset/
python json2npz.py --dataset_name <DATASET_NAME> --order <ORDER>
  • Generate the ground truth for evaluation.
cd dataset/
python json2npz_gt.py --dataset_name <DATASET_NAME>

Train

python train.py --dataset_name <DATASET_NAME> --order <ORDER> --model_name <MODEL_NAME> [--gpu <GPU_ID>]

Test

python test.py --dataset_name <DATASET_NAME> --order <ORDER> --model_name <MODEL_NAME> --save_image [--gpu <GPU_ID>]

Evaluation

python test.py --dataset_name <DATASET_NAME> --order <ORDER> --model_name <MODEL_NAME> --evaluate [--gpu <GPU_ID>]

Annotation Tool

  • There is a line segment annotation tool Labelline for pinhole, fisheye, and spherical images. If you want to build your own training dataset, it's may be helpful.

Citation

@article{LI2021187,
    title = {ULSD: Unified line segment detection across pinhole, fisheye, and spherical cameras},
    author = {Hao Li and Huai Yu and Jinwang Wang and Wen Yang and Lei Yu and Sebastian Scherer},
    journal = {ISPRS Journal of Photogrammetry and Remote Sensing},
    volume = {178},
    pages = {187-202},
    year = {2021},
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages