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 tflowd on that of our SOL9 C++ library. In order to develop our library, we have used the latest Python3.6, PyQt5, and OpenCV-4.1.0 on Windows 10 April 2018 Update environment. 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.

On installation of PyQt5, please see the site Installing PyQt5

To develop SOL4Py library, we created an environment tflow for tensorflow and installed the following libraries on Anaconda3(64-bit) Prompt of April 2018 Update Windows10.

(base) C:\sol4>conda create -yn tflow tensorflow
(base) C:\sol4>activate tflow

(tflow) C:\sol4>conda install PyQt5
(tflow) C:\sol4>conda install pandas
(tflow) C:\sol4>conda install matplotlib
(tflow) C:\sol4>conda install seaborn
(tflow) C:\sol4>conda install pydotplus
(tflow) C:\sol4>conda install -c conda-forge qimage2ndarray
(tflow) C:\sol4>conda install sklearn
(tflow) C:\sol4>conda install -c anaconda py-xgboost
(tflow) C:\sol4>conda install LightGBM
(tflow) C:\sol4>conda install tensorflow
(tflow) C:\sol4>conda install keras
(tflow) C:\sol4>conda install cx_Oracle
(tflow) C:\sol4>conda install pydot
(tflow) C:\sol4>conda install PyOpenGL
(tflow) C:\sol4>conda install graphviz

In the latest library, we have installed pytorch and torchvision

(tflow) C:\sol4>conda install pytorch torchvision -c pytorch

We have installled Unofficial Windows Binaries for Python Extension Packages: opencv_python-4.1.0 package in the following way:

(tflow) C:\sol4>pip install C:\Downloads\opencv_python-4.1.0-cp36-cp36m-win_amd64.whl

As you can easily identify, we have been using Python version 3.6.6

python -c "import sys; print(sys.version)"

, Tensorflow 1.13.1, Keras 2.2.4, OpenCV-4.1.0 and OpenGL 3.1.1a1. You can easily check their versions in the following way.

python -c "import tensorflow as tf; print(tf.__version__)"
python -c "import keras; print(keras.__version__)"
python -c "import cv2; print(cv2.__version__)"
python -c "import OpenGL as gl; print(gl.__version__)"

cx_Oracle7:
Furthermore, to connect Oracle12C Datatflow server from Python, we have been using cx_Oracle 7.0.0.

(tflow) python -c "import cx_Oracle; print(cx_Oracle.__version__)"


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.



    1.2 Download SOL4Py Library

    Download: SOL4Py-2.9 Class Library for Python (Library & Samples) #2019.07.17)


    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?

    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?




    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?




    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?




    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?








    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?







     Last modified: 17 July 2019

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