Welcome to Software Laboratory of Antillia.com.
    Future Windows and Linux Programming

  SOL4Py Class Library

  Home     SOL4Py Class List     SOL4Py Samples  

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.6, PyQt5, and OpenCV-4.2.0 on Windows 10 Version 1903. 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.


To develop SOL4Py library, we created a virtual environment tflow for tensorflow and installed the following libraries on python 3.6.5 (Windows x86-64 executable installer) Prompt of Windows10 Version 1903.

; 20200224 Modified to use python 3.6.5 (64-bit) instead of Anaconda3.
; Create a virtual env tflow
python -m venv tflow
cd tflow
scripts/activate

pip install opencv-python
pip install PyQt5
pip install pandas
pip install matplotlib
pip install seaborn
pip install pydotplus
pip install qimage2ndarray
pip install sklearn
pip install xgboost
pip install LightGBM
;2020/02/24 Modified to install tensorflow==1.5.0
pip install tensorflow==1.5.0
pip install keras==2.2.4
pip install cx_Oracle
pip install pydot
pip install PyOpenGL
pip install graphviz
; https://github.com/pytorch/pytorch/issues/19406
pip install torch==1.2.0+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install pycryptodome
pip install mysql-connector-python
; 20200224 Maybe you have to install pillow version like this
; to avoid ImportError: cannot import name 'PILLOW_VERSION'
pip install pillow==6.2.1
;To avoid Future warning, pip install numpy==1.16.0
pip install numpy==1.16.0


DetectionTransformer: Added 2020/08/20
We have downloaded DETR, which is a repository contains a list of Facebook DETR, and built an inference-environment to detect objects in an image by using a pretrained model.

For details, see DetectionTransformer.


EfficientDetector: Updated 2020/08/15
We have downloaded Google Brain AutoML, which is a repository contains a list of AutoML related models and libraries, and built an inference-environment to detect an image by using the model "efficientdet-d0".

For details, see EfficientDetector.



YOLOv3:
We have downloaded keras-yolo3, which is a python binding of YOLO: Real-Time Object Detection, and built a runtime-environment keras-yolo3 under SOL4Py-2 folder.

See a sample program YoloObjectDetector to detect objects in an image.

See a sample program CustomYoloObjectDetector. See also an another program DetectedObjectHTMLFileGenerator for keras-yolo3.


SSD:
We have downloaded ssd_keras, which is an SSD300v2 keras implementation of SSD: Single Shot MultiBox Detector, and built a runtime-environment ssd_keras under SOL4Py-2 folder.

See a sample program SSDDetector to detect objects in an image.

See also an another program SSDDetectedObjectHTMLFileGenerator for SSD300.


YOLOv3 vs SSD:
For comparison, please see the following three pages:

  • DetectedObjectHTMLFileGenerator for keras-yolo3

  • DetectedObjectHTMLFileGenerator for YOLOv3

  • SSDDetectedObjectHTMLFileGenerator for ssd_keras SSD300

  • YOLOv3 seems to have a much better detection ability than SSD300 apart from the processing time.



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

    NEW: 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)).

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



    1.2 Download SOL4Py Library

    Download: SOL4Py-3.2 Class Library for Python (Library & Samples) #2020.01.27)

    If you love github.com, please visit https://github.com/atlan-antillia/sol4py and clone the library so4py in the following way:

    git clone https://github.com/atlan-antillia/sol4py.git/



    2 How to use SOL4Py


    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?



    3.1 YOLOv3

    3.1.1 How to use yolo3 in Keras to detect objects in an image?

    3.1.2 How to derive CustomYoloObjectDetector class from YOLO class to display detailed information detected ?


    3.2 RoadSignsClassifier

    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 ZCustomImageDataGenerator and TorchRoadSignsDataset?



    4.1 LogWriter

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



    5.1 Torch CNN

    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 ImageDataGenerator

    6.1 How to create ZCustomImageDataGenerator class by using Pillow imaging library?

    6.2 How to preview images augmented by ZCustomImageDataGenerator?

    6.3 How to generate and save images generated by ZCustomImageDataGenerator?




    7.1 Cryptography

    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 MySQL

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

    8.2 How to use ZThreadedMySQLConnection in in MySQL?





    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.html?




    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.1.1 How to use yolo3 in Keras to detect objects in an image?




    3.1.2 How to derive CustomYoloObjectDetector class from YOLO class to display detailed information detected ?






    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??






     Last modified: 15 Aug. 2020

    Copyright (c) 2018-2020 Antillia.com ALL RIGHTS RESERVED.