I have a fully functional Python project which have been tested directly through the terminal.
http://www.brython.info/ http://www.skulpt.org/ http://pypyjs.org/ http://transcrypt.org/ http://stromberg.dnsalias.org/~strombrg/pybrowser/python-browser.html
I have used brython & was able to run few basic python codes
But my python project contain some import statements of libraries which I have installed directly into the OS using
apt-get install python-opencv apt-get install python-numpy apt-get install python-skimage apt-get install cython pip install --user imutils pip install --user scikit-image
And project contains import statements as
import imutils from skimage.filter import threshold_adaptive import numpy as np import argparse import cv2
Any help would be appreciated. Thanks in Advance
Brython is a transpiler for Python code -
There are efforts in the sense of running native-code on the Browser (nacl ) and other approaches, but I am not aware of the state of these, or these usng the cPython runtime on the browser.
Have your image-dealing code server side, and build a backend that allows you to call RPC functions on the server, from code on the Brython side.
You just have to expose the desired openCV functionality in HTTP Views, using a common Python framework like Flask or Pyramid - setting up the code to transfer image data and operation meta-data between the browser and this server won't be a hard thing to do using Brython.
Another side note:
Brython won't allow you to import arbitrary files you've installed on your system - while it will likely work with any pure-Python3 code which does not perform I/O , the files have to be placed in specific paths, that are served through HTTP, so that Brython's import machinery can get them
©2020 All rights reserved.