git clone --recurse-submodules https://github.com/cvg/DeepLSD.git
----------------------直接用----------------------------
cd DeepLSD
bash quickstart_install.sh
mkdir weights
wget https://www.polybox.ethz.ch/index.php/s/FQWGkH57UNTqlJZ/download -O weights/deeplsd_wireframe.tar
wget https://www.polybox.ethz.ch/index.php/s/XVb30sUyuJttFys/download -O weights/deeplsd_md.tar
报错AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'
安装cv python新版本:
pip install opencv-python==4.6.0.66
python3 untitled.py
--------------------训练测试-------------------------------
1.安装gflags和glog
apt-get install libgoogle-glog-dev
---安装gflags
git clone https://github.com/gflags/gflags.git
cd gflags
mkdir build && cd build
cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_SHARED_LIBS=ON ..
make -j8
sudo make install
sudo ldconfig
----安装glog,注意报无法定义log的错误,可能原因是glog版本,这里采用0.5.0。另外ceres报错了从1.14.0变为2.2.0
git clone https://github.com/google/glog
cd glog
mkdir build && cd build
cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_SHARED_LIBS=ON ..
make -j8
sudo make install
2.下载eigen3.3.9和ceres-solver1.14.0
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3 libgtest-dev libgflags-dev libgoogle-glog-dev
----编译安装eigen
cd eigen-3.3.9
mkdir build
cd build
cmake ..
make -j8
sudo make install
----编译安装ceres
cd ceres-solver-1.14.0
mkdir build
cd build
cmake ..
make -j12
sudo make install
4.
sudo apt update
C++环境下 OpenCV 的安装
#sudo apt install libopencv-dev
#安装依赖
sudo apt install libjpeg-dev libpng-dev libtiff-dev
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libxvidcore-dev libx264-dev
#下载源码
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.9.0.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.9.0.zip
unzip opencv.zip
unzip opencv_contrib.zip
mkdir -p build && cd build
#cmake配置
cmake -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.9.0/modules ../opencv-4.9.0
-D CMAKE_INSTALL_PREFIX=/usr/local
-D BUILD_EXAMPLES=FALSE
#编译
make -j24
sudo make install
------------------------------------
安装pytlbd失败
pip install pyproject.toml
sudo apt-get install libarpack2-dev libparpack2-dev
sudo apt-get install libarpack++2-dev
sudo cp -r /usr/local/include/eigen3/unsupported /usr/local/include
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
-------------------------------------------------------------------------
修改代码:
data_path = '../data/v1.1/train'
jpg_file = data_path + '/{}'.format(img_path)
print(jpg_file)
img = cv2.imread(jpg_file, 0)
修改路径settings.py:
EXPER_PATH = '../data/deeplsd/' #输出路径
DATA_PATH = '../data' #数据根目录,与yaml文件中的路径进行拼接
修改yaml文件:
dataset_dir: v1.1
gt_dir: export/wireframe_ha5 #生成的hdf5文件路径
--------------------------------------------------------------------------
python -m deeplsd.scripts.homography_adaptation_df ../data/v1.1/train.txt ../data/export --num_H 100 --n_jobs 4
python -m deeplsd.scripts.train deeplsd_wireframe --conf deeplsd/configs/train_wireframe.yaml
python -m deeplsd.scripts.line_refinement <path to the image folder> <path to the line detections> <path to the checkpoint of DeepLSD>
标签:..,记录,make,deeplsd,dev,opencv,install,过程 From: https://www.cnblogs.com/yhlx125/p/18069240