After the previous article explained how to train a neural network with your own training data, this article is about calling the neural network, i.e. testing it. Since the AI Pipeline has API interfaces, we will use exactly this API interface for this test and let the objects be recognized on a test image, i.e. predictions. The offered API interfaces make the Training Suite so interesting because with their help the Training Suite can be flexibly integrated into own AI applications. Therefore, it makes sense to have seen and tried out this SWAGGER API interface once in order to develop a feeling for its application and possible uses.
SWAGGER API – Testing a neural network
When the training is finished, you want to find out how well the trained neural network can now recognize objects. In the overview of all training jobs in the Training Suite, there is a small menu with three buttons at the top. I would like to explain these buttons briefly using the following illustration.
- This button can be used to create new training jobs.
- With this button it is possible to download ready trained neural networks as a ZIP file.
- With the lightning button you can access the SWAGGER API interface of the Training Suite.
Now press the button with the small lightning (number 3) to open the SWAGGER API. The screen that is now displayed should look like the one shown in the following figure.
Now please open the function “GET list Labels” by clicking on the “Get” button. When the function is expanded, press the “Try it out” button to activate this function in the web interface.
A large Execute button with a blue background appears. Please press this button now. The function is then executed and it may take a short time until the display is updated.
After the function has been executed, a list of already trained neural networks appears that can be used for image prediction. You should now recognize your trained neural networks by the name you gave them when you created the training job. The important thing now is to find the model you want to try in the list. Therefore it is important to follow the naming conventions so that every user can find exactly the net he wants to test or use.
Now please copy the name of the neural network into the clipboard of your computer. Now search for the function “POST Predict Image” on the web interface of the SWAGGER API as shown in the following figure and please execute it now.
- The previously copied neural network name must be pasted in this line.
- Then, ideally, select a test image that was not yet part of the training of the neural net.
- Press the big Execute button.
Now it takes a few seconds for the central computer to analyze the image by the selected neural network. When the analysis is complete, an image with bounding boxes is returned by the Training Suite. Also the %-values are in the image with which probability the object in the image was detected and what it is.
The result of this prediction looks as shown in the following figure. The bounding boxes are a bit hard to see here but in the original output you can see them much better.
Now you have learned the No-Code API pipeline from image labeling, training of a neural network and testing of the trained neural network. In order for the Training Suite to start automatically on the central server like the Labeltool Lite, here is a short explanation of how to set up the autostart function.
Training Suite – Autostart
To ensure that the Training Suite also starts automatically after each restart of the computer, only a small adjustment must be made to the run_gpu.yml file. To do this, the run_gpu.yml file only needs to be adjusted in three places. In the following picture the three adapted places of the run_gpu.yml file are highlighted. Here, the line “restart: always” was inserted in each case, which causes the Docker container to start automatically after a restart of the computer.
For the adjustment now open the run_gpu.yml file with an editor and make the adjustments at the three described places. Simply add the entry “restart: always” and save the adjustments. For a test now start the Training Suite as usual with the following command.
Command: sudo docker-compose -f run_gpu.yml up
If the adjustments have been made, the Training Suite has been restarted and can be used as usual, it is now time to restart the computer once to check whether the Training Suite also starts automatically after a restart of the computer and can be called.
If this works, the autostart of the Training Suite is now configured.
After this short excursion into the world of REST API interfaces and thanks to SWAGGER quite simple operation, the installation and configuration of the AI Pipeline Image App follows in another tutorial, which significantly simplifies the use of the REST API interface of the Training Suite and provides a better overview including download function of the analysis results.
Article Overview - How to set up the AI pipeline:AI Pipeline - Introduction of the tutorial
AI Pipeline - An Overview
AI Pipeline - The Three Components
AI Pipeline - Hardware Basics
AI Pipeline - Hardware Example Configurations
AI Pipeline - Software Installation of the No-Code AI Pipeline
AI Pipeline - Labeltool Lite - Installation
AI Pipeline - Labeltool Lite - Preparation
AI Pipeline - Labeltool Lite - Handling
AI Pipeline - Tensorflow Object Detection Training-GUI - Installation
AI Pipeline - Tensorflow Object Detection Training GUI - Run
AI Pipeline - Tensorflow Object Detection Training GUI - Usage
AI Pipeline - Tensorflow Object Detection Training GUI - SWAGGER API testing the neural network
AI Pipeline - AI Pipeline Image App Setup and Operation Part 1-2
AI Pipeline - AI Pipeline Image App Setup and Operation Part 2-2
AI Pipeline - Training Data Download
AI Pipeline - Anonymization-Api