chaquopy

com.chaquo.python.PyException: ImportError: This platform lacks a functioning sem_open with multiprocessing

六月ゝ 毕业季﹏ 提交于 2021-02-10 14:36:34
问题 I am building an application that works on windows and in python. It builds correctly and this issue looks like it should have been fixed in 7.0.3 of chaquopy; however it does not work for me. I have included the logcat from the attempt to run on the android vm. Any help would be really appreciated. I can include more error messages or more output from the logcat if needed. // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext

com.chaquo.python.PyException: ImportError: This platform lacks a functioning sem_open with multiprocessing

帅比萌擦擦* 提交于 2021-02-10 14:35:23
问题 I am building an application that works on windows and in python. It builds correctly and this issue looks like it should have been fixed in 7.0.3 of chaquopy; however it does not work for me. I have included the logcat from the attempt to run on the android vm. Any help would be really appreciated. I can include more error messages or more output from the logcat if needed. // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext

Chaquopy problems with nltk and download

六眼飞鱼酱① 提交于 2021-02-04 08:08:48
问题 According to Chaquopy Not able to download Resource i'm not sure if the problem got solved. So here is question in the nltk context. After including one of the nltk.download line: nltk.download('popular') or nltk.download('punkt') or nltk.download('all') I get this stack trace: 2020-08-26 13:33:45.742 19765-19765/com.pro.useyournotes E/ExceptionTag: com.chaquo.python.PyException: BadZipFile: File is not a zip file com.chaquo.python.PyException: BadZipFile: File is not a zip file at <python>

TypeError calling python function using chaquopy

﹥>﹥吖頭↗ 提交于 2021-01-29 08:29:46
问题 I have a python file which has many 'def' values in it. When I try to integrate the python file with android studio, I get a type error. The input is a image file and I want the lowerRange and upperRange to be based on that image, so I cannot define a value to them, since image size can vary everytime. import numpy as np import cv2 import os import matplotlib.pyplot as plt from PIL import Image def host(croppedImage,lowerRange, upperRange): mask_yellow = cv2.inRange(croppedImage,lowerRange

Chaquopy: error while reading a text file from python code “No such file or directory”

只愿长相守 提交于 2021-01-28 03:30:24
问题 I am using python as a backend code for some scientific programs in the android app. For that, I am using the Chaquopy plugin. I found an error "No such file or directory" when accessing the text file which is stored at "app/src/main/python/". I think this is a path issue. 回答1: In Chaquopy 6.3.0 and later, you can access data files using a path relative to __file__ . For example, if the data file is in the same directory as the Python file: from os.path import dirname, join filename = join

Converting Arrays and Tensors in Chaquopy

白昼怎懂夜的黑 提交于 2019-12-24 06:34:18
问题 How do I do this? I saw your post saying that you can just pass java Objects to Python methods but this is not working for numpy arrays and TensorFlow tensors. The following, and various variation of this, is what I tried and to no avail. double[][] anchors = new double[][]{{0.57273, 0.677385}, {1.87446, 2.06253}, {3.33843, 5.47434}, {7.88282, 3.52778}, {9.77052, 9.16828}}; PyObject anchors_ = numpy.callAttr("array", anchors); I also tried to use concatenate to create this but it does not

How to Use OpenCV Wait Key With Chaquopy

青春壹個敷衍的年華 提交于 2019-12-24 04:07:09
问题 I am attempting to use Chaquopy to port a computer vision application to android. When I try to run my script the following error occurs on the following line: cv2.waitKey(100) The error which prints to the embedded python console is: java.chaquopy.CQPEnv.check_exception com.chaquo.python.PyException: error: OpenCV(3.4.2) /home/smith/git/chaquo/python/server/pypi/packages/opencv-python/build/3.4.2.16/cp36-cp36m-android_15_armeabi_v7a/src/opencv/modules/highgui/src/window.cpp:698: error: (-2

How to convert an opencv Mat into a numpy.ndarray?

我的未来我决定 提交于 2019-12-20 03:52:20
问题 I have a code written in java (android) that open the camera of the phone and show frames. The below code represents the method in which we can retrieve frames. The project used Chaquopy to interpret python code. @Override public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) { mRgba = inputFrame.rgba(); Python py = Python.getInstance(); PyObject pym = (PyObject) py.getModule("MyPythonClass").callAttr("call",mRgba); return mRgba; } The python code is used to retrieve the