lessthanoptimal / PyBoof

Python wrapper around the BoofCV Computer Vision Library
Apache License 2.0
67 stars 12 forks source link

Exception: Yeah this needs to be implemented. Turn mmap on if possible #2

Closed lijingpeng closed 4 years ago

lijingpeng commented 5 years ago

image = pb.re(img_path, np.uint8) config_fh = pb.ConfigFastHessian() config_fh.extractRadius = 4 config_fh.maxFeaturesPerScale = 300

Create the detector and use default for everything else

feature_detector = pb.FactoryDetectDescribe(np.uint8).createSurf(config_detect=config_fh)
# Detect features in the first image
locs, desc = feature_detector.detect(image)

Traceback (most recent call last): File "/Users/frank/Documents/workspace/python/vector_search/object_detection_bow/test.py", line 23, in surf_feature('/Users/frank/Downloads/nike1.jpg') File "/Users/frank/Documents/workspace/python/vector_search/object_detection_bow/test.py", line 13, in surf_feature locs, desc = feature_detector.detect(image) File "/usr/local/lib/python3.7/site-packages/pyboof/feature.py", line 257, in detect locations = pyboof.b2p_list_point2D(java_locations,np.double) File "/usr/local/lib/python3.7/site-packages/pyboof/geo.py", line 326, in b2p_list_point2D raise Exception("Yeah this needs to be implemented. Turn mmap on if possible") Exception: Yeah this needs to be implemented. Turn mmap on if possible

So,what's wrong?

lessthanoptimal commented 5 years ago

If you add pb.init_memmap(5) to the beginning of your code does it go away?

https://github.com/lessthanoptimal/PyBoof/blob/master/examples/match_features.py

Two different protocols are available for communication with JVM. mmap is by far faster and the other method isn't always implemented.