[Py4j-users] faster way to convert arrays from python to Java
Status: Beta
Brought to you by:
barthe
From: Peter <dih...@gm...> - 2015-07-16 00:34:01
|
I know this is a known/fundamental issue, but just wanted place my request for a faster way to convert large arrays between the two. I'm written a wrapper around BoofCV, which is a computer vision library in Java, using Py4J. For the most part it has been really easy to do and works well. The one major problem I have is that loading an image in python then passing it to Java is glacial. For example, when tracking objects inside a video sequence it takes 28ms to process the image, but 95ms to convert it from a numpy format into the BoofCV format! Kinda kills any hope of doing something in real-time. Yes I know you said not to use this library if you want speed, but it's actually almost there. Would it be possible to do some sort of hackery like share a large chunk of memory between the two and use that to do copies? - Peter |