Code Monkey home page Code Monkey logo

Comments (12)

eragonruan avatar eragonruan commented on May 18, 2024

@SuryaprakashNSM did you run demo in the root directory?

from text-detection-ctpn.

SuryaprakashNSM avatar SuryaprakashNSM commented on May 18, 2024

No, from ..\text-detection-ctpn\ctpn directory.

from text-detection-ctpn.

eragonruan avatar eragonruan commented on May 18, 2024

you should run in text-detection-ctpn directory

from text-detection-ctpn.

SuryaprakashNSM avatar SuryaprakashNSM commented on May 18, 2024

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.

eragonruan avatar eragonruan commented on May 18, 2024

@SuryaprakashNSM yes, just open make.sh and execute the code one by one

from text-detection-ctpn.

cjt222 avatar cjt222 commented on May 18, 2024

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.

eragonruan avatar eragonruan commented on May 18, 2024

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.

SuryaprakashNSM avatar SuryaprakashNSM commented on May 18, 2024

@cjt222 Yeah right now I am facing the same issue. @eragonruan can u help us with this error.

image

from text-detection-ctpn.

eragonruan avatar eragonruan commented on May 18, 2024

I will test on windows soon.

from text-detection-ctpn.

SuryaprakashNSM avatar SuryaprakashNSM commented on May 18, 2024

Thanks man .. U r the best.

from text-detection-ctpn.

eragonruan avatar eragonruan commented on May 18, 2024

@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.

ankur7721 avatar ankur7721 commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.