Comments (12)
@SuryaprakashNSM did you run demo in the root directory?
from text-detection-ctpn.
No, from ..\text-detection-ctpn\ctpn directory.
from text-detection-ctpn.
you should run in text-detection-ctpn directory
from text-detection-ctpn.
Yeah .. that helped. Also Im trying to run it windows.
Is there an alternate for these:
cd lib/utils
chmod +x make.sh
./make.sh
from text-detection-ctpn.
@SuryaprakashNSM yes, just open make.sh and execute the code one by one
from text-detection-ctpn.
hello,when i run it on windows,it may cause some errors。when i run python setup.py build_ext --inplace, some errors like below,windows may do not has so file, do you have solution? thanks so @MUCH!!!
AttributeError: 'MSVCCompiler' object has no attribute 'compiler_so' @eragonruan @SuryaprakashNSM
from text-detection-ctpn.
I did not test on windows, building python library in windows is inconvenient, you can use nms implemented in pure python instead
from text-detection-ctpn.
@cjt222 Yeah right now I am facing the same issue. @eragonruan can u help us with this error.
from text-detection-ctpn.
I will test on windows soon.
from text-detection-ctpn.
Thanks man .. U r the best.
from text-detection-ctpn.
@SuryaprakashNSM you can delete code reelated to cuda in setup.py and use bbox and nms implemented in cython. you can use mingw32 or vs to build these two modules. but this process may be trouble some, you can refer to this page.
Or you can use nms and bbox implemented in pure python which do not need to build.
py_nms
import numpy as np
def nms(dets, thresh):
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = dets[:, 3]
scores = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
order = scores.argsort()[::-1]
keep = []
while order.size > 0:
i = order[0]
keep.append(i)
xx1 = np.maximum(x1[i], x1[order[1:]])
yy1 = np.maximum(y1[i], y1[order[1:]])
xx2 = np.minimum(x2[i], x2[order[1:]])
yy2 = np.minimum(y2[i], y2[order[1:]])
w = np.maximum(0.0, xx2 - xx1 + 1)
h = np.maximum(0.0, yy2 - yy1 + 1)
inter = w * h
ovr = inter / (areas[i] + areas[order[1:]] - inter)
inds = np.where(ovr <= thresh)[0]
order = order[inds + 1]
return keep
py_bbox
import numpy as np
def bbox_overlaps(boxes,query_boxes):
N = boxes.shape[0]
K = query_boxes.shape[0]
overlaps = np.zeros((N, K))
for k in range(K):
box_area = (
(query_boxes[k, 2] - query_boxes[k, 0] + 1) *
(query_boxes[k, 3] - query_boxes[k, 1] + 1)
)
for n in range(N):
iw = (
min(boxes[n, 2], query_boxes[k, 2]) -
max(boxes[n, 0], query_boxes[k, 0]) + 1
)
if iw > 0:
ih = (
min(boxes[n, 3], query_boxes[k, 3]) -
max(boxes[n, 1], query_boxes[k, 1]) + 1
)
if ih > 0:
ua = float(
(boxes[n, 2] - boxes[n, 0] + 1) *
(boxes[n, 3] - boxes[n, 1] + 1) +
box_area - iw * ih
)
overlaps[n, k] = iw * ih / ua
return overlaps
def bbox_intersections(boxes,query_boxes):
N = boxes.shape[0]
K = query_boxes.shape[0]
intersec = np.zeros((N, K))
for k in range(K):
box_area = (
(query_boxes[k, 2] - query_boxes[k, 0] + 1) *
(query_boxes[k, 3] - query_boxes[k, 1] + 1)
)
for n in range(N):
iw = (
min(boxes[n, 2], query_boxes[k, 2]) -
max(boxes[n, 0], query_boxes[k, 0]) + 1
)
if iw > 0:
ih = (
min(boxes[n, 3], query_boxes[k, 3]) -
max(boxes[n, 1], query_boxes[k, 1]) + 1
)
if ih > 0:
intersec[n, k] = iw * ih / box_area
return intersec
from text-detection-ctpn.
@eragonruan @SuryaprakashNSM I am facing similar issue, Can either of you tell me how would modified setup.py would look like ? Please post the complete setup.py code instead of only smaller snippet, since I am not able to find which parts to delete.
from text-detection-ctpn.
Related Issues (20)
- WARNING:tensorflow:From /home/chen/anaconda3/envs/py3/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
- 百度网盘的权重链接失效了,有哪位大佬能提供下训练好的权重文件吗? HOT 4
- training with images from google
- demo.py中 将box转换为原始尺寸时,代码可能有一点小错误
- Crop detected region with result from .txt file but I got the wrong region? HOT 1
- loss值不下降,检测为0
- 请问有data 数据的百度云链接吗? 过期了 HOT 3
- It does not work with tensorflow 2.3.1
- bug in utils.py
- Resource Exhausted: OOM issue
- how to create our own training model? HOT 1
- when i train model My gpu utilization is nearly 0
- ImportError: cannot import name 'bbox' from partially initialized module 'lib.utils' (most likely due to a circular import) (/home/barry/Github/chinese_ocr/ctpn/lib/utils/__init__.py) HOT 3
- 如何预测anchor在X方向上的偏移?有人实现了么,当前模型检测出的文本行,两边会有多余的边缘,在识别的时候,多出的部分严重影响识别效果,
- 运行spilt_label.py结果一直显示Error processing HOT 1
- File "nms.pyx", line 28, in bbox.nms.nms ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'
- there are some problem in check[oints HOT 1
- Model Quantization
- 请问怎样把检测出来的长文本进行字符切割?
- Required Python Version 2.7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from text-detection-ctpn.