Skip to content

sarah-antillia/SOL4Py_V4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOL4Py-V4 (Updated: 2022/06/15)

1 What is SOL4Py
1.1 SOL4Py
SOL4Py is a tiny Python class library for Python, PyQt, OpenCV, and ML.
The basic class design of SOL4Py is based on that of our SOL9 C++ library. In order to develop our library, we have used the latest Python3.8, Tensorflow 2.7.0, torch 1.10, PyQt5, and OpenCV-4.5 on Windows 10 Version 20H2. We have tested the sample programs on Windows 10 only, but you may run them on Linux environment too, provided you install required Python, PyQt, OpenCV modules on Linux.

  • 2022/06/08: We have created a SOL4Py package(SOL4Py-4.0.0-py3-none-any.wh), please down load SOL4Py-4_Installer.zip to install the package.

  • We created a virtual environment py38 to develop SOL4Py library.

    ; 20220615 Modified to use python 3.8, tensorflow 2.8.0 and torch 1.10.1.
    ; Create a virtual env py38
    python -m venv c:\py38
    cd py38
    scripts/activate
    pip install -r requirements.txt
    

    Freeglut

    Please download freeglut-2.8.1, and build freeglut.dll from the solution file in:
    C:\freeglut-2.8.1\VisualStudio\2012\freeglut.sln
    
    You may also download the precompiled lib.zip(freeglut.dll freeglut.lib) built by Visual Studio 2022.
    Copy C:\freeglut-2.8.1\lib\x64\freeglut.dll under C:\Windows\system32.

    You have to modify win32.py file in C:\py38\Lib\site-packages\OpenGL\platform in the following way.

       @baseplatform.lazy_property
        def GLUT( self ):
            #for possible in ('freeglut%s.%s'%(size,vc,),  'glut%s.%s'%(size,vc,)):
            for possible in ('freeglut%s.%s'%(size,vc,), 'freeglut', 'glut%s.%s'%(size,vc,)):
    

    Crypto classes
    We have implemented some wrapper classes to Cipher classes(AES and ChaCha20) of pycrytodome package.

    Generator classes
    We have implemented some generator classes(ZEmailAddressGenerator, ZPasswordGenerator and ZTokenGenerator), By using those classes, you can generate a lot of fake personal data (personally identifiable information (PII)).

    MySQLDB classes
    We have implemented some wrapper classes to MySQL(ZMySQLDB, ZThreadedMySQLConnection) based on mysql-connector-python.



    1.2 Ubuntu 20.04LTS
    In Ubuntu 20.04LTS environment, you have to run the following commands.
    $ sudo apt install x11-apps
    $ sudo apt install libgl1-mesa-dev xorg-dev
    $ sudo apt install libopencv-dev python3-opencv
    $ sudo apt install freeglut3 freeglut3-dev libglew-dev
    $ sudo apt install qtbase5-dev qttools5-dev-tools qt5-default
    $ pip install -r requirements.txt
    $ pip install opencv-contrib-python-headless
    
    If you would like to run GUI applications (Qt5, OpenCV and OpenGL) of sol4py on Windows10/wsl2, you have to install X-Server on Windows10.
    VcXsrv Windows X Server

    OpenGL example on Ubuntu 20.04LTS of Windows11/wsl2




    2.1 Basic User Interface

    2.1.1 How to use ZApplicationView?

    2.1.2 How to use ZImageView?

    2.1.3 How to use ZLabeledComboBox?

    2.1.4 How to use ZLabeledSlider?

    2.1.5 How to use ZScrolledImageView?

    2.1.6 How to use ZColorPositioner?

    2.1.7 How to use FolderBrowser?

    2.1.8 How to use TabbedWindow?


    2.2 OpenCV

    2.2.1 How to use ZOpenCVImageView?

    2.2.2 How to use cv2.boxFilter?

    2.2.3 How to use cv2.adaptiveThreshold?

    2.2.4 How to use cv2.AKAZE feature detector?

    2.2.5 How to use cv2.createStitcher? Fixed bug in OpenCV-4.2.0

    2.2.6 How to use cv2.GaussianBlur and cv2.addWeighted?

    2.2.7 How to use cv2.getStructuringElement and cv2.morphologyEx?

    2.2.8 How to use cv2.FlannBasedMatcher?

    2.2.9 How to use cv2.edgePreservingFilter, cv2.detailEnhance and cv2.pencilSketch?

    2.2.10 How to use cv2.CascadeClassifier to detect faces?

    2.2.11 How to use cv2.HOGDescriptor to detect pedestrians?

    2.2.12 How to use cv2.VideoCapture to display video files?

    2.2.13 How to use a scrolled plotting area to draw a figure of matplotlib and seaborn?

    2.2.14 How to inject the Gaussian noise to an image of OpenCV?



    2.3 Keras CNN

    2.3.1 How to use CIFAR-10 and CIFAR-100 datasets on cnn model for image classification?

    2.3.2 How to use MNIST and FashionMNIS datasets on cnn model for image classification?

    2.3.2 How to use VGG16 cnn model for image classification?

    2.3.2 How to use inception-v3 cnn model for image classification?


    2.4 ML

    2.4.1 How to use DecisionTreeClassifier?

    2.4.2 How to use LightGBMClassifiers?

    2.4.3 How to use RandomForestRegressor?

    2.4.4 How to use XGBClassifier?



    2.5 Socket

    2.5.1 How to use CustomThreadedTCPServer?

    2.5.2 How to use CustomThreadedUDPServer?

    2.5.3 How to use CustomThreadingMixInTCPServer.html?

    2.5.4 How to use CustomThreadingMixInUDPServer?

    2.5.5 How to use NonblockingTCPServerThread?



    2.6 Oracle12C

    2.6.1 How to insert data into a table of Oracle12C?

    2.6.2 How to select records from a table of Oracle12C ?



    2.7 OpenGL

    2.7.1 How to render a colored pyramid in OpenGL?

    2.7.2 How to rotate a cube by timer thread in OpenGL?

    2.7.3 How to rotate multiple materialized toruses in OpenGL?

    2.7.4 How to rotate a multiple jpg textured cubes in OpenGL?

    2.7.5 How to map a texture in OpenGL?

    2.7.6 How to rotate a textured sphere in OpenGL?

    2.7.7 How to use axis-eye-light-positioner to render a textured sphere in OpenGL?

    2.7.8 How to render a buffered colored regular icosahedron in OpenGL?

    2.7.9 How to render a cube textured by OpenCV-NonPhotorealistic images in OpenGL?

    2.7.10 How to show OpenGLView and OpenCVView on a window in SOL4Py?



    2.8 Keras samples

    2.8.1 How to preview images generated by Keras ImageDataGenerator?

    2.8.2 How to create an image classifier for your image data by using CNN?

    2.8.3 How to visualize training accuracy and loss in Keras Model fitting process by using matplotlib?

    2.8.4 How to derive MNISTDenoisingAutoEncoder class from MNISTAutoEndoder?

    2.8.5 How to create PictogramClassifier to TOKYO2020-SPORT-PICTOGRAMS by using Keras ImageDataGenerator?

    2.8.6 How to apply Keras AutoEncoder to color images of VegeFruits dataset?




    2.1 Basic Sample Programs



    2.1.1 How to use ZApplicationView?




    2.1.2 How to use ZImageView?




    2.1.3 How to use ZLabeledComboBox?




    2.1.4 How to use ZLabeledSlider?




    2.1.5 How to use ZScrolledImageView?




    2.1.6 How to use ZColorPositioner?





    2.1.7 How to use FolderBrowser?





    2.1.8 How to use TabbedWindow?





    2.2.1 How to use ZOpenCVImageView?




    2.2.2 How to use cv2.boxFilter?




    2.2.3 How to use cv2.adaptiveThreshold?




    2.2.4 How to use cv2.AKAZE feature detector?




    2.2.5 How to use cv2.createStitcher?

    In OpenCV-4.0.0 and 4.1.0, this sample program didn't work well by a stitcher bug. In OpenCV-4.2.0 the bug has been fixed, and this runs well.




    2.2.6 How to use cv2.GaussianBlur and cv2.addWeighted?




    2.2.7 How to use cv2.getStructuringElement and cv2.morphologyEx?




    2.2.8 How to use cv2.FlannBasedMatcher?




    2.2.9 How to use cv2.edgePreservingFilter, cv2.detailEnhance and cv2.pencilSketch?




    2.2.10 How to use cv2.CascadeClassifier to detect faces?




    2.2.11 How to use cv2.HOGDescriptor to detect pedestrians?




    2.2.12 How to use cv2.VideoCapture to display video files?




    2.2.13 How to use a scrolled plotting area to draw a figure of matplotlib and seaborn?




    2.2.14 How to inject the Gaussian noise to an image of OpenCV?




    2.3.1 How to use CIFAR-10 and CIFAR-100 datasets on cnn model for image classification?




    2.3.2 How to use MNIST and FashionMNIS datasets on cnn model for image classification?




    2.3.3 How to use VGG16 cnn model for image classification?




    2.3.4 How to use inception-v3 cnn model for image classification?




    2.4.1 How to use DecisionTreeClassifier?




    2.4.2 How to use LightGBMClassifiers?




    2.4.3 How to use RandomForestRegressor?




    2.4.4 How to use XGBClassifier?




    2.5.1 How to use CustomThreadedTCPServer?




    2.5.2 How to use CustomThreadedUDPServer?




    2.5.3 How to use CustomThreadingMixInTCPServer.py?




    2.5.4 How to use CustomThreadingMixInUDPServer?




    2.5.5 How to use NonblockingTCPServerThread?




    2.6.1 How to insert data into a table of Oracle12C?




    2.6.2 How to select records from a table of Oracle12C ?




    2.7.1 How to render a colored pyramid in OpenGL?




    2.7.2 How to rotate a cube by timer thread in OpenGL?




    2.7.3 How to rotate multiple materialized toruses in OpenGL?




    2.7.4 How to rotate a multiple jpg textured cubes in OpenGL?




    2.7.5 How to map a texture in OpenGL?




    2.7.6 How to rotate a textured sphere in OpenGL?




    2.7.7 How to use axis-eye-light-positioner to render a textured sphere in OpenGL?





    2.7.8 How to render a buffered colored regular icosahedron in OpenGL?




    2.7.9 How to render a cube textured by OpenCV-NonPhotorealistic images in OpenGL?




    2.7.10 How to show OpenGLView and OpenCVView on a window in SOL4Py?




    2.8.1 How to preview images generated by Keras ImageDataGenerator?




    2.8.2 How to create an image classifier for your image data by using CNN?








    2.8.3 How to visualize training accuracy and loss in Keras Model fitting process by using matplotlib?





    2.8.4 How to derive MNISTDenoisingAutoEncoder class from MNISTAutoEndoder?




    2.8.5 How to create PictogramClassifier to TOKYO2020-SPORT-PICTOGRAMS by using Keras ImageDataGenerator?








    2.8.6 How to apply Keras AutoEncoder to color images of VegeFruits dataset?








    3.2.1 How to create RoadSignsClassifier to classify the roadsigns in an image by using Keras ImageDataGenerator?








    3.2.2 How to create TorchRoadSignsClassifier to classify the roadsigns in an image by using ZImageDataGenerator and TorchRoadSignsDataset?








    4.1 How to create LogWriter(ZLogger) class to write a string of format of [datetime, log-level, filename, line-no, function, message] to multiple streams?




    5.1 How to create TorchInceptionV3Classifier to use pretrained torch inceptionv3 model?








    5.2 How to visualize training accuracy and loss in Torch Model fitting process by using matplotlib and tqdm(progress bar)?








    5.3 How to create TorchMNISTClassifier by using ZTorchMNISTModel?








    5.4 How to create TorchCIFARClassifier by using TorchCIFARModel?







    5.5 How to create TorchPictogramClassifier to TOKYO2020-SPORT-PICTOGRAMS by using ZImageDataGenerator and Torch_TOKYO2020_SPORT_PICTOGRAMS_Dataset?







    5.6 How to create ZPILGaussianNoise and insert it into Torch image transforms Composer?






    6.1 How to create ZCustomImageDataGenerator by using Pillow image library?





    6.2 How to preview images augmented by ZCustomImageDataGenerator?







    6.3 How to generate and save images generated by ZCustomImageDataGenerator?





    7.1 How to encrypt and decrypt strings by using ZAESCipher?





    7.2 How to encrypt and decrypt files by using ZAESIVEmbedeCipher?





    7.3 How to encrypt and decrypt strings by using ZChaCha20Ciper?





    7.4 How to encrypt and decrypt strings by using ZChaCha20NonceEmbeddeCiper?



    8.1 8.1 How to encrypt and decrypt a password in a MySQL table by using ZAESIVEmbeddedCipher?





    8.2 8.2 How to use ZThreadedMySQLConnection in in MySQL??




    About

    No description, website, or topics provided.

    Resources

    License

    Apache-2.0, Unknown licenses found

    Licenses found

    Apache-2.0
    LICENSE
    Unknown
    LICENSE.txt

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages