How cvg/deeplsd works
Project type and purpose
• DeepLSD is an open-source, research-oriented deep learning library and CLI toolkit for generic line segment detection and refinement in images.
• It combines a Python-based neural network backbone with a C++ optimization module for final line refinement.
File structure
• Top-level directories:
• deeplsd/ ← core Python package
• line_refinement/ ← C++ solver wrapped via pybind11
• third_party/ ← bundled external libraries (AFM, homography_est, progressive-x, pytlbd, pytlsd)
• notebooks/ ← Jupyter demos
• assets/, scripts, configs, requirements.txt, setup/install scripts
• Inside deeplsd/:
• configs/ ← YAML files for train/export/eval
• datasets/ ← data loaders & augmentation
• models/ ← network definitions & inference wrappers
• geometry/ ← homography, projection, visualization
• evaluation/ ← line detection & VP metrics
• utils/ ← experiment tracking, tensor tools, CLI helpers
• scripts/ ← entry-point Python files (train, export, evaluate, refine)
• settings.py ← global paths (EXPER_PATH, DATA_PATH)
README for additional insights
• Architecture is config-driven: all experiments rely on YAML files.
• Two main workflows:
a) Training & exporting features (distance/angle fields)
b) Inference & line refinement (via C++ module)
• External dependencies: OpenCV, GFlags, GLog, Ceres, CUDA, Python 3.7+, GCC 9.