EAST代码的采坑记录

2020-09-12  本文已影响0人  每天必吃香菜

EAST论文:https://arxiv.org/abs/1704.03155v2

EAST-github代码:https://github.com/argman/EAST

一、lanms无法编译的错误:

错误所示:

RuntimeError: Cannot compile lanms: /home/zhengyujie/EAST-master/lanms

网上查过很多方法都没有解决这个问题,所以我将eval.py文件中第100行的boxes = lanms.merge_quadrangle_n9(boxes.astype('float32'), nms_thres)

换成了boxes = nms_locality.nms_locality(boxes.astype(np.float64), nms_thres),然后注释掉了import lanms。

另一种方法,就是修改Makefile文件:

CXXFLAGS = -I include -std=c++11 -O3  $(shell python3-config --cflags)

LDFLAGS = $(shell python3-config --ldflags)

DEPS = lanms.h $(shell find include -xtype f)

CXX_SOURCES = adaptor.cpp include/clipper/clipper.cpp

LIB_SO = adaptor.so

$(LIB_SO): $(CXX_SOURCES) $(DEPS)

$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(CXX_SOURCES) --shared -fPIC

clean:

rm -rf $(LIB_SO)

改为:

CXXFLAGS = -I include -std=c++11 -O3 -I/home/XXX/anaconda3/include/python3.6m/

LDFLAGS = $(shell python3-config --ldflags)

DEPS = lanms.h $(shell find include -xtype f)

CXX_SOURCES = adaptor.cpp include/clipper/clipper.cpp

LIB_SO = adaptor.so

$(LIB_SO): $(CXX_SOURCES) $(DEPS)

$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(CXX_SOURCES) --shared -fPIC

clean:

rm -rf $(LIB_SO)

二、调用测试代码显示0 images:

直接都换成换成绝对路径

python eval.py --test_data_path=/home/XXX/EAST-master/tmp/ch4_test_images/ --gpu_list=0  --checkpoint_path=/home/XXX/EAST/master/tmp/east_icdar2015_resnet_v1_50_rbox/ --output_dir=/home/XXX/EAST-master/tmp/tested_images/

三、

/home/XXX/EAST-master/icdar.py:250: RuntimeWarning: invalid value encountered in float_scalars

  return np.linalg.norm(np.cross(p2 - p1, p1 - p3)) / np.linalg.norm(p2 - p1)

/home/XXX/EAST-master/icdar.py:250: RuntimeWarning: invalid value encountered in float_scalars

  return np.linalg.norm(np.cross(p2 - p1, p1 - p3)) / np.linalg.norm(p2 - p1)

(目前未解决,胆代码可以继续正常运行)

上一篇 下一篇

猜你喜欢

热点阅读