Official implementation of "LSDNet: Trainable Modification of LSD Algorithm for Real-Time Line Segment Detection." by Teplyakov, Lev, Leonid Erlygin, and Evgeny Shvets. IEEE Access 10 (2022): 45256-45265.
links to the paper: IEEE Access, arXiv.org
Images from Wireframe dataset of varying number of salient line segments
LSD detector
HAWP detector
M-LSD-tidy detector
LSDNet, the proposed detector
WARNING: all the scripts run in docker container without GPU support. We preferred plug-and-play demo with low FPS to top performance with hardcore NVIDIA-docker installation.
cd devops
sh build_image.sh
it takes about 10 min, it will download all the requirements and compile OpenCV the way we need it.
The Interactive Demo allows you to play with LSDNet on single images.
To launch the demo server (based on Gradio) run
cd devops
sh launch_web_vis.sh
This commad will launch a web server and print its address. The interface should look like this.
To make predictions on your images, specify in devops/detect_lines.sh
the following variables:
input_path
- path to an images folder or a single image (images must bepng
orjpg
)out_path
- path where predicted segments will be saved in.txt
format (x1
,y1
,x2
,y2
,conf
) - the coordinates of segments' endpoints and segment confidence
As a container mounts to the repo's root directory, paths above must be:
- relative to
lsd/detect_lines.py
file - inside the repo's directory
Then make predictions on your images with
cd devops
sh detect_lines.sh