[LEADERG APP] CSPNet

 [Introduction]

 

Use CSPResNeXt50 for image classification. An example is to use steel plate defect classification. You can use this APP to train your images for image classification.

 

 

[Operation steps and instructions]

 

Open the APP, please refer to the LEADERG-APP operating instructions.

APP has four main functions: data preparation, training, inference, and others.

 

APP CSPNet.png  

Data preparation :

 

1. Select the data set for AI learning.

If you want to train your image, please click browse to open the file location. It is recommended to copy a default data folder and change it to your own data name.

Then find the train, val, and test folders, delete the old images in the folders and replace them with images that you need to train, infer, and test.

Note: The file name of the image needs to comply with the requirements: The file name of the image must be prefixed with [category name-], for example: inclusion in inclusion-1.jpg is the category name of the image.

 

Select dataset.png  

2. Set the number of categories and category names.

  • Set the number of categories, click [Classes num] to open the text file, find classes = 4, the number 4 is the number of categories of your data. For example: the training image has 5 categories => classes = 5.
  • Set the category name, click [Classes name] to open the text file, and set the training category name.
  • cfg configuration file. Click [99. edit CSPNet.cfg] and find [avgpool]. Below this you can find filters=4. The number 4 is the number of categories of your data. For example: the training images have 5 categories => filters=5.

 

Set the number of categories and category names.png Set the number of categories of cfg.png

 

3. Click [1. prepare train txt] and [2. prepare val txt] to automatically generate a list of images for training and verification.

 

Generate training and validation lists.png  

 

Training:

 

If your device supports NVIDIA GPU accelerated computing, please click [3. train (GPU)]; if NVIDIA GPU accelerated computing is not supported, please click [3. train (CPU)].

 

training.png

 

 

Inference:

 

The app provides inferences for a single image or all images in a folder.

1. Inferring a single image : If your device supports NVIDIA GPU accelerated computing, please click [4. inference (GPU)]; if NVIDIA GPU accelerated computing is not supported, please click [4. inference (CPU)].

Then please select an image you want to infer, press [Open] to infer and display the result.

 

Inferring a single image.png  

2. Inference folder: If your device supports NVIDIA GPU accelerated computing, please click [5. inference_folder (GPU)]; if NVIDIA GPU accelerated computing is not supported, please click [5. inference_folder (CPU)].

Then please select the folder you want to infer, press [Open] to infer and display the result.           

Please press any key on the keyboard to switch to the next image on the displayed result image.

 

Inference folder.png

 

Other:

1. Click [99. edit CSPNet.cfg] to open the text file of the CSPNet network structure.

2. Click [99. browse data] to open the data folder.

 

Other functions.png