primetang / pylsd Goto Github PK
View Code? Open in Web Editor NEWpython bindings for LSD - Line Segment Detector.
License: Other
python bindings for LSD - Line Segment Detector.
License: Other
This package includes bundled AGPL code, so it can't have a BSD license. This is going to mislead downstream consumers into contaminating their code bases.
File "D:\Program Files\pycharm\PyCharm 2020.1.1\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\Program Files\pycharm\PyCharm 2020.1.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "E:/codeProject/py/LSD.py", line 9, in
lsd(gray)
File "C:\Users\yang\anaconda3\lib\site-packages\pylsd\lsd.py", line 22, in lsd
fp = open(temp, 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'E:/codeProject/py/845480ntl.txt'
Environment:
python:3.6.9
pylsd:ocrd-fork-pylsd == 0.0.3
OS: Linux16.04
from pylsd.lsd import lsd
img = cv2.imread("./a.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGRA2GRAY)
lines = lsd(gray)
Memory leaks occur when as above code is used.
I installed the pylsd module using pip3 install pylsd
while trying to run import pylsd i get the below error
Unable to import the pylsd module
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/thalish/.virtualenvs/lib/python3.5/site-packages/pylsd/__init__.py", line 8, in <module>
from lsd import lsd
ImportError: cannot import name 'lsd'
Does the code not work for python 3.x ?
I get the following error when I try to run example_cv2.py
Traceback (most recent call last):
File "E:\pylsd\example\example_cv2.py", line 16, in
lines = lsd(gray)
TypeError: 'module' object is not callable
How to solve it?
I installed pylsd
library, however, I go this error
from lsd import lsd
ImportError: cannot import name 'lsd'
Looks like memory leak is still in place in case of some data.
Test data:
https://drive.google.com/file/d/145nGKKlH93v8WIg2IEnZ5e0_GFXCynJQ/view?usp=sharing
Code to reproduce:
import os, psutil
import cv2
import numpy as np
from pylsd.lsd import lsd
img = np.load('array.bin.npy')
process = psutil.Process(os.getpid())
if len(img.shape) == 3:
img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
while True:
lines = lsd(img, quant=0.7)
print(process.memory_info().rss)
ImportError: Cannot load dynamic library. Did you compile LSD?
I am just use pip3.6 to install the package,
but a try-except syntax error occurs when I import it.
pylsd/bindings/lsd_ctypes .py: line 34
except Exception, e:
pass
fix:
except Exception as e:
pass
Traceback (most recent call last):
File "YOUR_FILE.py", line 29, in
lines = lsd(gray)
File "C:\YOUR_WORKING_DIRECTORY\pylsd_repo\pylsd\lsd.py", line 24, in lsd
fp = open(temp, 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/YOUR_WORKING_DIRECTORY/536135ntl.txt'
Fix README.md
from pylsd import lsd
gives error TypeError: 'module' object is not callable
.from pylsd.lsd import lsd
### 1.
###1.
(No space).A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.