PeterJohnNumPyV4
iPhone / developpeurs
****PeterJohnNumPyV4
Now You Can Use NumPy 1.20.2 on CPython3.9.9.
****How To Use NumPy on PeterJohnNumPyV4;;
Go To
"TutorialSeason003/scripts/s007LSTMtrainingPlot.py".
Then
"Run Script".
****Not Yet implemented Features;;
Basically, you Can Use all Functions of numpy.ndarray.
**1; numpy.random;;
please use Python3 Standard "random" module instead of it.
1.1); numpy.random.randn();;
So we implemented pjRandN() function using NumPy and Python3 Standard "random" module.
Documents/TutorialSeason003/scripts/pjLStermMemory.py;pjRandN()
**2; numpy.linalg;;
2.1); numpy.linalg.norm();;
So we implemented pjNorm() function using NumPy instead of it.
Documents/TutorialSeason003/scripts/pjLStermMemory.py;pjNorm()
2.2); numpy.linalg.qr();;
So we implemented pjQR() function using NumPy instead of it.
Documents/TutorialSeason003/scripts/pjLStermMemory.py;pjQR();
**3; numpy.diag();;
Basically, you Can Use all Functions of numpy.ndarray,
so Please use numpy.ndarray.diagonal() instead of it.
**4; numpy.fft; Not Yet implemented.
**5; numpy.polynomial;; Not Yet implemented.
**6; numpy.ctypeslib;; Not Yet implemented.
****When you Use this App withOut NumPy;;
Using iPhone's "Files.app", Delete the NumPy's "__pycache__" folder below.
Documents/PeterJohnNumPyV4/usrLocal/lib/python3.9/site-packages/numpy/__pycache__
If there doesNot Exist the NumPy's "__pycache__" folder,
when you touched "Edit Script",
this App Calls "Py_FinalizeEx()"
So you Can Enjoy Scripting Comfortably.
****the WorkAround against the Well-Known Bug of NumPy and Python3.9;;
NumPy and Python3.9 have a Well-Known Bug.
While NumPy has been imported, "Py_FinalizeEx()" doesNot Release memory.
So If you imported NumPy at the Second time, Python3 Crashes.
so we made a WorkAround against the Well-Known Bug of NumPy and Python3.9.
As the Specification of this App,
If there Exists the NumPy's "__pycache__" folder,
Documents/PeterJohnNumPyV4/usrLocal/lib/python3.9/site-packages/numpy/__pycache__
Even if you touched "Edit Script",
this App doesNot call "Py_FinalizeEx()"
This is Not a Perfect Solution But you Can Enjoy NumPy withOut Python3 Crashing.
****1st Corinthians 10:31, GNT;
10:31 Well, whatever you do, whether you eat or drink, do it all for God's glory.
Enjoy NumPy on PeterJohnNumPyV4.
Best Regards,
--Yasushi Yassun Obata
Quoi de neuf dans la dernière version ?
'OpenCV-Python' ( OpenCV-Python Bindings ) Available Version;
Now you Can Use 'OpenCV-Python' on 'PeterJohnNumPy'.
you will also be able to use 'OpenCV-Python' on
'PeterJohnNumPyMatplotlib' and 'PeterJohnPyTorch', maybe soon.
'OpenCV-Python' needs NumPy as the data representation,
so PeterJohnThreeDim which doesNot have NumPy,
canNot Support 'OpenCV-Python'.
if you need 'OpenCV-Python',
please Upgrade to 'PeterJohnNumPy', ''PeterJohnNumPyMatplotlib'
or 'PeterJohnPyTorch'.
****Two Examples;
We prepared two examples at this time;
TutorialSeason003/s006opencvPythonMachineLearning.py;
TutorialSeason003/s007opencvPythonVideoCaptureMachineLearning.py
****Two-Unimplemented Features;
OpenCV-Python on PeterJohnNumPy has Two-Unimplemented Features;
1) cap = cv2.VideoCapture()
OpenCV-Python on PeterJohnNumPy can't start
VideoCapture directly.
2) ret, img = cap.read()
OpenCV-Python on PeterJohnNumPy can't read frame
from VideoCamera directly.
But, instead of Abobe Two,
Use 'pjOpenCV as cvCPP';
So that you Can Edit the image captured from VideoCamera,
using 'OpenCV-Python'.
****How to Edit the image captured from VideoCamera;
1) setup VideoCapture;
import pjOpenCV as cvCPP
cvCPP.setVideoCaptureFPS(10)
##cvCPP.initVideoCaptureBackCamera()
cvCPP.initVideoCaptureFrontCamera()
##cvCPP.flipCamera() ## flipCamera()
2) start VideoCapture;
captured image is Stored as the UIImage 'srcImg';
cvCPP.startVideoCapture()
import cv2
3) To Get Captured image, use 'cvCPP.saveSrcImg()'.
cvCPP.saveSrcImg( srcAbsPath )
img = cv2.imread( srcAbsPath )
4) Edit the NumPy image, Using "OpenCV-Python".
5) To Reflect the edited NumPy image on the UIImage 'destImg',
use 'cvCPP.createDestImg';
cv2.imwrite(destAbsPath, img)
cvCPP.createDestImg(destAbsPath)
6) To Show the UIImage 'destImg', use 'cvCPP.showDestImg()'.
cvCPP.showDestImg()
Enjoy MachineLearning,
Enjoy DeepLearning,
--Yasushi Yassun Obata