whai362 / PSENet

Official Pytorch implementations of PSENet.
Apache License 2.0
1.17k stars 345 forks source link

a problem about pse #34

Open huziling opened 5 years ago

huziling commented 5 years ago

当我在编译 pse相关文件的时候遇到了这个报错 adaptor.cpp:35:86: error: ‘connectedComponents’ was not declared in this scope 我的环境中的opencv 分别是pip 安装的opencv-python 版本为4.0.0 和 4.1.0 gcc g++ 版本为5.4 请问这个问题是怎么回事呢? 是否需要安装低版本的opencv 或者是需要 从源码编译opencv @whai362

huziling commented 5 years ago

i uninstall opencv 4.xx and try opencv 3.4.5 and it still not work

huziling commented 5 years ago

i also try a opecv 3.1.0 and still not work . May you give me a adaptor.so. Thanks

JackLongKing commented 5 years ago

I met this too! Make sure your opencv in /usr/include/ dir or modify the Makefile to config your opencv. @ @huziling

huziling commented 5 years ago

I met this too! Make sure your opencv in /usr/include/ dir or modify the Makefile to config your opencv. @ @huziling

my opencv is opencv-python, and i find lot`s of file like libopencvxxx.so in /usr/include/ i try pkg-config --cflags --libs opencv and the result is

-I/usr/include/opencv /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/x86_64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/x86_64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv it`s seem my opencv is in /usr/include/ ,

thank for your reply, but i still can`t solve this problem

JackLongKing commented 5 years ago

if you only use opencv-python, maybe you can use pse module in python way offered by author. If you want to use pse module in C++, modify the Makefile, and my Makefile looks like: ` CXXFLAGS = -I include -std=c++11 -O3 -I/home/gulong/mylib/opencv_ruliang/include

DEPS = lanms.h $(shell find include -xtype f) CXX_SOURCES = adaptor.cpp include/clipper/clipper.cpp

OPENCV =-Wl,-rpath=/home/gulong/opencv_ruliang/lib/

LIB_SO = adaptor.so

$(LIB_SO): $(CXX_SOURCES) $(DEPS) $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(CXX_SOURCES) --shared -fPIC $(OPENCV)

clean: rm -rf $(LIB_SO) ` Modify the path of opencv, and make again. @ huziling

huziling commented 5 years ago

Thanks for your help!!! I will try install opencv with source code

soldier828 commented 5 years ago

当我在编译 pse相关文件的时候遇到了这个报错 adaptor.cpp:35:86: error: ‘connectedComponents’ was not declared in this scope 我的环境中的opencv 分别是pip 安装的opencv-python 版本为4.0.0 和 4.1.0 gcc g++ 版本为5.4 请问这个问题是怎么回事呢? 是否需要安装低版本的opencv 或者是需要 从源码编译opencv @whai362

Did you solve it ?

huziling commented 5 years ago

hi! 我最近下载了opencv的源码 并且make了 我下载的位置在 /mnt/3T/xxx/opencv 其中有 /mnt/3T/xxx/opencv/include 和 /mnt/3T/xxx/opencv/build/lib/ 这是是否意味着我应该修改Makefile 为: CXXFLAGS = -I include -std=c++11 -O3 -I /mnt/3T/xxx/opencv/include DEPS = lanms.h $(shell find include -xtype f) CXX_SOURCES = adaptor.cpp include/clipper/clipper.cpp OPENCV =-Wl,-rpath=/mnt/3T/xxx/opencv/build/lib/ LIB_SO = adaptor.so $(LIB_SO): $(CXX_SOURCES) $(DEPS) $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(CXX_SOURCES) --shared -fPIC $(OPENCV) clean: rm -rf $(LIB_SO) 我在尝试如此修改后 会提示 /bin/sh: 1: /mnt/3T/xxx/opencv/include: Permission denied /bin/sh: 1: /mnt/3T/xxx/opencv/build/lib/: Permission denied cc1plus: warning: adaptor.cpp: not a directory 并且在测试时会出现dynamic module does not define init function (initadaptor) 请问你有什么见解吗 @JackLongKing @whai362

huziling commented 5 years ago

当我在编译 pse相关文件的时候遇到了这个报错 adaptor.cpp:35:86: error: ‘connectedComponents’ was not declared in this scope 我的环境中的opencv 分别是pip 安装的opencv-python 版本为4.0.0 和 4.1.0 gcc g++ 版本为5.4 请问这个问题是怎么回事呢? 是否需要安装低版本的opencv 或者是需要 从源码编译opencv @whai362

Did you solve it ? 我仍未解决这个问题,只能采用了另外一个使用python版 opencv的pse,虽然比起纯python的pse快,但是仍然达不到纯c++版本的速度

duoduo1234 commented 5 years ago

@JackLongKing,我用你所提到,MAKE了OPENCV,然后Makefile如你所说修改,结果adaptor.so生成了。可是运行test_ic15.py的时候,又发生了错误: ImportError: ………………/PSENet/pse/adaptor.so: undefined symbol: _ZN2cv8fastFreeEPv 我是CUDA10,PYTHON2.7

huziling commented 5 years ago

@JackLongKing,我用你所提到,MAKE了OPENCV,然后Makefile如你所说修改,结果adaptor.so生成了。可是运行test_ic15.py的时候,又发生了错误: ImportError: ………………/PSENet/pse/adaptor.so: undefined symbol: _ZN2cv8fastFreeEPv 我是CUDA10,PYTHON2.7 我也遇到了这个问题,我最终的解决方法是删除了所有旧版本的opencv文件,将编译的opencv装进user/local 并写道全局路径中,然后不改动makefile

duoduo1234 commented 5 years ago

@huziling 那你的FPS值正常吗?

huziling commented 5 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

    我没有测试过,我试过另外一个版本的fps稍低于论文,理论上讲这个肯定比那个好

                            278820314

                                278820314@qq.com

    签名由
    网易邮箱大师
    定制

On 5/24/2019 12:18,duoduo1234<notifications@github.com> wrote: 

@huziling 那你的FPS值正常吗?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

hetianduan commented 5 years ago

@JackLongKing,我用你所提到,MAKE了OPENCV,然后Makefile如你所说修改,结果adaptor.so生成了。可是运行test_ic15.py的时候,又发生了错误: ImportError: ………………/PSENet/pse/adaptor.so: undefined symbol: _ZN2cv8fastFreeEPv 我是CUDA10,PYTHON2.7

你好,你的问题解决了吗 我的情况和你一样

pilhoon commented 5 years ago

try this.

  1. install opencv 3.4 from source
  2. modify pse/Makefile from OPENCV = pkg...blabla to OPENCV = -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib64 -lopencv_dnn -lopencv_highgui -lopencv_ml -lopencv_objdetect -lopencv_stitching -lopencv_shape -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_videoio -lopencv_imgcodecs -lopencv_features2d -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core
  3. at command line, export LD_LIBRARY_PATH=/usr/local/lib64
  4. then make (be sure that pse/adaptor.so does not exist. After the make you will have one.)
HongChow commented 4 years ago

@JackLongKing,我用你所提到,MAKE了OPENCV,然后Makefile如你所说修改,结果adaptor.so生成了。可是运行test_ic15.py的时候,又发生了错误: ImportError: ………………/PSENet/pse/adaptor.so: undefined symbol: _ZN2cv8fastFreeEPv 我是CUDA10,PYTHON2.7

你好,你的问题解决了吗 我的情况和你一样 我的问题和你们一样, 请问你们解决了没?