gitanat/simple-ocr-opencv

error with the operator "-" in code

Closed this issue · 6 comments

TypeError: numpy boolean subtract, the - operator, is deprecated, use the bitwise_xor, the ^ operator, or the logical_xor function instead.

class ContainedFilter(Filter):
"""desirable segments are not contained by any other"""

def _good_segments(self, segments):
    m = contained_segments_matrix(segments)
    return (True - numpy.max(m, axis=1))

Should I install something or i need to change it manually?

srry I just ran it on the command promp and worked

Hello,

I am getting the same error what do you mean by running on command prompt? I ran python3 example_grounding.py from my command line and it is failing?

@mit456 This is the same issue as #29 . Numpy has deprecated the - operator for arrays. @goncalopp did post he cherry-picked the fix, but I can't find it on any pushed branches. You can use a numpy version of 1.13.0 or earlier (if I'm not mistaken), or you could cherry-pick the changes from my fork of the repository from the numpy branch.

@RedFantom
Thanks!
You're absolutely right, the commit isn't there, apparently I cherry picked it back to master on 09/03, but forgot to push to github - I've fixed that now :)

@mit456
Can you please try the most recent version in the master branch and see if the problem goes away?

@goncalopp It works with the latest master, I tested it.

@mit456 Great, thanks!