--- comments: true --- # Image Classification Module Development Tutorial ## I. Overview The image classification module is a crucial component in computer vision systems, responsible for categorizing input images. The performance of this module directly impacts the accuracy and efficiency of the entire computer vision system. Typically, the image classification module receives an image as input and, through deep learning or other machine learning algorithms, classifies it into predefined categories based on its characteristics and content. For instance, in an animal recognition system, the image classification module might need to classify an input image as "cat," "dog," "horse," etc. The classification results from the image classification module are then output for use by other modules or systems. ## II. List of Supported Models > The inference time only includes the model inference time and does not include the time for pre- or post-processing.
| Model | Model Download Link | Top1 Acc(%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (MB) |
|---|---|---|---|---|---|
| CLIP_vit_base_patch16_224 | Inference Model/Training Model | 85.36 | 12.03 / 2.49 | 60.86 / 42.69 | 331 |
| MobileNetV3_small_x1_0 | Inference Model/Training Model | 68.2 | 4.23 / 0.78 | 5.24 / 1.48 | 10.5 |
| PP-HGNet_small | Inference Model/Training Model | 81.51 | 5.87 / 1.68 | 25.58 / 18.50 | 86.5 |
| PP-HGNetV2-B0 | Inference Model/Training Model | 77.77 | 4.41 / 0.87 | 10.58 / 1.87 | 21.4 |
| PP-HGNetV2-B4 | Inference Model/Training Model | 83.57 | 7.05 / 1.16 | 16.23 / 7.55 | 70.4 |
| PP-HGNetV2-B6 | Inference Model/Training Model | 86.30 | 13.86 / 3.28 | 67.25 / 56.70 | 268.4 |
| PP-LCNet_x1_0 | Inference Model/Training Model | 71.32 | 2.59 / 0.68 | 3.18 / 1.19 | 10.5 |
| ResNet50 | Inference Model/Training Model | 76.5 | 6.25 / 1.17 | 15.93 / 9.72 | 90.8 |
| SwinTransformer_tiny_patch4_window7_224 | Inference Model/Training Model | 81.10 | 7.11 / 2.01 | 62.72 / 47.35 | 100.1 |
| Model | Model Download Link | Top-1 Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (MB) | Description |
|---|---|---|---|---|---|---|
| CLIP_vit_base_patch16_224 | Inference Model/Training Model | 85.36 | 12.03 / 2.49 | 60.86 / 42.69 | 331 | CLIP is an image classification model based on the correlation between vision and language. It adopts contrastive learning and pre-training methods to achieve unsupervised or weakly supervised image classification, especially suitable for large-scale datasets. By mapping images and texts into the same representation space, the model learns general features, exhibiting good generalization ability and interpretability. With relatively good training errors, it performs well in many downstream tasks. |
| CLIP_vit_large_patch14_224 | Inference Model/Training Model | 88.1 | 49.15 / 9.75 | 223.16 / 206.49 | 1040 | |
| ConvNeXt_base_224 | Inference Model/Training Model | 83.84 | 11.37 / 5.65 | 143.98 / 52.31 | 313.9 | The ConvNeXt series of models were proposed by Meta in 2022, based on the CNN architecture. This series of models builds upon ResNet, incorporating the advantages of SwinTransformer, including training strategies and network structure optimization ideas, to improve the pure CNN architecture network. It explores the performance limits of convolutional neural networks. The ConvNeXt series of models possesses many advantages of convolutional neural networks, including high inference efficiency and ease of migration to downstream tasks. |
| ConvNeXt_base_384 | Inference Model/Training Model | 84.90 | 29.48 / 11.17 | 293.76 / 134.27 | 313.9 | |
| ConvNeXt_large_224 | Inference Model/Training Model | 84.26 | 22.99 / 12.73 | 220.79 / 113.24 | 700.7 | |
| ConvNeXt_large_384 | Inference Model/Training Model | 85.27 | 58.90 / 24.63 | 509.48 / 260.27 | 700.7 | |
| ConvNeXt_small | Inference Model/Training Model | 83.13 | 7.72 / 4.35 | 95.92 / 33.34 | 178.0 | |
| ConvNeXt_tiny | Inference Model/Training Model | 82.03 | 6.00 / 2.47 | 63.59 / 18.23 | 104.1 | |
| FasterNet-L | Inference Model/Training Model | 83.5 | 11.96 / 2.68 | 51.93 / 35.33 | 357.1 | FasterNet is a neural network designed to improve runtime speed. Its key improvements are as follows: 1. Re-examined popular operators and found that low FLOPS mainly stem from frequent memory accesses, especially in depthwise convolutions; 2. Proposed Partial Convolution (PConv) to extract image features more efficiently by reducing redundant computations and memory accesses; 3. Launched the FasterNet series of models based on PConv, a new design scheme that achieves significantly higher runtime speeds on various devices without compromising model task performance. |
| FasterNet-M | Inference Model/Training Model | 83.0 | 11.17 / 2.16 | 38.49 / 21.17 | 204.6 | |
| FasterNet-S | Inference Model/Training Model | 81.3 | 7.70 / 1.24 | 19.51 / 11.22 | 119.3 | |
| FasterNet-T0 | Inference Model/Training Model | 71.9 | 4.73 / 0.82 | 6.40 / 1.96 | 15.1 | |
| FasterNet-T1 | Inference Model/Training Model | 75.9 | 4.80 / 0.80 | 8.14 / 3.13 | 29.2 | |
| FasterNet-T2 | Inference Model/Training Model | 79.1 | 6.10 / 0.88 | 12.71 / 5.35 | 57.4 | |
| MobileNetV1_x0_5 | Inference Model/Training Model | 63.5 | 1.98 / 0.51 | 2.50 / 1.04 | 4.8 | MobileNetV1 is a network released by Google in 2017 for mobile devices or embedded devices. This network decomposes traditional convolution operations into depthwise separable convolutions, which are a combination of Depthwise convolution and Pointwise convolution. Compared to traditional convolutional networks, this combination can significantly reduce the number of parameters and computations. Additionally, this network can be used for image classification and other vision tasks. |
| MobileNetV1_x0_25 | Inference Model/Training Model | 51.4 | 1.99 / 0.45 | 1.82 / 0.73 | 1.8 | |
| MobileNetV1_x0_75 | Inference Model/Training Model | 68.8 | 2.33 / 0.41 | 3.33 / 1.34 | 9.3 | |
| MobileNetV1_x1_0 | Inference Model/Training Model | 71.0 | 2.31 / 0.45 | 3.91 / 1.89 | 15.2 | |
| MobileNetV2_x0_5 | Inference Model/Training Model | 65.0 | 3.58 / 0.62 | 3.86 / 1.23 | 7.1 | MobileNetV2 is a lightweight network proposed by Google following MobileNetV1. Compared to MobileNetV1, MobileNetV2 introduces Linear bottlenecks and Inverted residual blocks as the basic structure of the network. By stacking these basic modules extensively, the network structure of MobileNetV2 is formed. Finally, it achieves higher classification accuracy with only half the FLOPs of MobileNetV1. |
| MobileNetV2_x0_25 | Inference Model/Training Model | 53.2 | 3.05 / 0.66 | 3.30 / 0.98 | 5.5 | |
| MobileNetV2_x1_0 | Inference Model/Training Model | 72.2 | 3.85 / 0.63 | 5.50 / 1.87 | 12.6 | |
| MobileNetV2_x1_5 | Inference Model/Training Model | 74.1 | 3.93 / 0.73 | 8.84 / 3.12 | 25.0 | |
| MobileNetV2_x2_0 | Inference Model/Training Model | 75.2 | 3.89 / 0.79 | 10.36 / 4.50 | 41.2 | |
| MobileNetV3_large_x0_5 | Inference Model/Training Model | 69.2 | 4.60 / 0.77 | 5.32 / 1.58 | 9.6 | MobileNetV3 is a NAS-based lightweight network proposed by Google in 2019. To further enhance performance, relu and sigmoid activation functions are replaced with hard_swish and hard_sigmoid activation functions, respectively. Additionally, some improvement strategies specifically designed to reduce network computations are introduced. |
| MobileNetV3_large_x0_35 | Inference Model/Training Model | 64.3 | 4.44 / 0.75 | 5.20 / 1.50 | 7.5 | |
| MobileNetV3_large_x0_75 | Inference Model/Training Model | 73.1 | 5.30 / 0.85 | 6.02 / 1.93 | 14.0 | |
| MobileNetV3_large_x1_0 | Inference Model/Training Model | 75.3 | 5.38 / 0.81 | 7.16 / 2.19 | 19.5 | |
| MobileNetV3_large_x1_25 | Inference Model/Training Model | 76.4 | 5.54 / 0.84 | 7.06 / 2.84 | 26.5 | |
| MobileNetV3_small_x0_5 | Inference Model/Training Model | 59.2 | 3.87 / 0.77 | 4.90 / 1.32 | 6.8 | |
| MobileNetV3_small_x0_35 | Inference Model/Training Model | 53.0 | 3.68 / 0.77 | 3.94 / 1.27 | 6.0 | |
| MobileNetV3_small_x0_75 | Inference Model/Training Model | 66.0 | 3.92 / 0.77 | 4.68 / 1.39 | 8.5 | |
| MobileNetV3_small_x1_0 | Inference Model/Training Model | 68.2 | 4.23 / 0.78 | 5.24 / 1.48 | 10.5 | |
| MobileNetV3_small_x1_25 | Inference Model/Training Model | 70.7 | 4.59 / 0.79 | 5.36 / 1.63 | 13.0 | |
| MobileNetV4_conv_large | Inference Model/Training Model | 83.4 | 9.04 / 2.28 | 34.34 / 22.01 | 125.2 | MobileNetV4 is an efficient architecture specifically designed for mobile devices. Its core lies in the introduction of the UIB (Universal Inverted Bottleneck) module, a unified and flexible structure that integrates IB (Inverted Bottleneck), ConvNeXt, FFN (Feed Forward Network), and the latest ExtraDW (Extra Depthwise) module. Alongside UIB, Mobile MQA, a customized attention block for mobile accelerators, was also introduced, achieving up to 39% significant acceleration. Furthermore, MobileNetV4 introduces a novel Neural Architecture Search (NAS) scheme to enhance the effectiveness of the search process. |
| MobileNetV4_conv_medium | Inference Model/Training Model | 79.9 | 5.70 / 1.05 | 13.78 / 5.64 | 37.6 | |
| MobileNetV4_conv_small | Inference Model/Training Model | 74.6 | 3.81 / 0.55 | 5.24 / 1.50 | 14.7 | |
| MobileNetV4_hybrid_large | Inference Model/Training Model | 83.8 | 13.43 / 4.28 | 61.16 / 31.06 | 145.1 | |
| MobileNetV4_hybrid_medium | Inference Model/Training Model | 80.5 | 11.82 / 1.30 | 22.01 / 6.06 | 42.9 | |
| PP-HGNet_base | Inference Model/Training Model | 85.0 | 13.43 / 3.81 | 71.24 / 51.48 | 249.4 | PP-HGNet (High Performance GPU Net) is a high-performance backbone network developed by Baidu PaddlePaddle's vision team, tailored for GPU platforms. This network combines the fundamentals of VOVNet with learnable downsampling layers (LDS Layer), incorporating the advantages of models such as ResNet_vd and PPHGNet. On GPU platforms, this model achieves higher accuracy compared to other SOTA models at the same speed. Specifically, it outperforms ResNet34-0 by 3.8 percentage points and ResNet50-0 by 2.4 percentage points. Under the same SLSD conditions, it ultimately surpasses ResNet50-D by 4.7 percentage points. Additionally, at the same level of accuracy, its inference speed significantly exceeds that of mainstream Vision Transformers. |
| PP-HGNet_small | Inference Model/Training Model | 81.51 | 5.87 / 1.68 | 25.58 / 18.50 | 86.5 | |
| PP-HGNet_tiny | Inference Model/Training Model | 79.83 | 5.84 / 1.38 | 17.03 / 10.58 | 52.4 | |
| PP-HGNetV2-B0 | Inference Model/Training Model | 77.77 | 4.41 / 0.87 | 10.58 / 1.87 | 21.4 | PP-HGNetV2 (High Performance GPU Network V2) is the next-generation version of Baidu PaddlePaddle's PP-HGNet, featuring further optimizations and improvements upon its predecessor. It pushes the limits of NVIDIA's "Accuracy-Latency Balance," significantly outperforming other models with similar inference speeds in terms of accuracy. It demonstrates strong performance across various label classification and evaluation scenarios. |
| PP-HGNetV2-B1 | Inference Model/Training Model | 79.18 | 4.52 / 0.73 | 11.98 / 2.28 | 22.6 | |
| PP-HGNetV2-B2 | Inference Model/Training Model | 81.74 | 6.67 / 0.96 | 14.22 / 4.04 | 39.9 | |
| PP-HGNetV2-B3 | Inference Model/Training Model | 82.98 | 7.47 / 1.94 | 17.73 / 5.63 | 57.9 | |
| PP-HGNetV2-B4 | Inference Model/Training Model | 83.57 | 7.05 / 1.16 | 16.23 / 7.55 | 70.4 | |
| PP-HGNetV2-B5 | Inference Model/Training Model | 84.75 | 10.38 / 1.95 | 31.53 / 18.02 | 140.8 | |
| PP-HGNetV2-B6 | Inference Model/Training Model | 86.30 | 13.86 / 3.28 | 67.25 / 56.70 | 268.4 | |
| PP-LCNet_x0_5 | Inference Model/Training Model | 63.14 | 2.41 / 0.60 | 2.54 / 0.90 | 6.7 | PP-LCNet is a lightweight backbone network developed by Baidu PaddlePaddle's vision team. It enhances model performance without increasing inference time, significantly surpassing other lightweight SOTA models. |
| PP-LCNet_x0_25 | Inference Model/Training Model | 51.86 | 2.16 / 0.60 | 2.73 / 0.77 | 5.5 | |
| PP-LCNet_x0_35 | Inference Model/Training Model | 58.09 | 2.18 / 0.60 | 2.32 / 0.89 | 5.9 | |
| PP-LCNet_x0_75 | Inference Model/Training Model | 68.18 | 2.61 / 0.58 | 3.00 / 1.09 | 8.4 | |
| PP-LCNet_x1_0 | Inference Model/Training Model | 71.32 | 2.59 / 0.68 | 3.18 / 1.19 | 10.5 | |
| PP-LCNet_x1_5 | Inference Model/Training Model | 73.71 | 2.60 / 0.68 | 3.98 / 1.66 | 16.0 | |
| PP-LCNet_x2_0 | Inference Model/Training Model | 75.18 | 2.53 / 0.68 | 5.21 / 2.24 | 23.2 | |
| PP-LCNet_x2_5 | Inference Model/Training Model | 76.60 | 2.76 / 0.67 | 6.78 / 3.20 | 32.1 | |
| PP-LCNetV2_base | Inference Model/Training Model | 77.05 | 4.04 / 0.62 | 6.80 / 2.67 | 23.7 | The PP-LCNetV2 image classification model is the next-generation version of PP-LCNet, self-developed by Baidu PaddlePaddle's vision team. Based on PP-LCNet, it has undergone further optimization and improvements, primarily utilizing re-parameterization strategies to combine depthwise convolutions with varying kernel sizes and optimizing pointwise convolutions, Shortcuts, etc. Without using additional data, the PPLCNetV2_base model achieves over 77% Top-1 Accuracy on the ImageNet dataset for image classification, while maintaining an inference time of less than 4.4 ms on Intel CPU platforms. |
| PP-LCNetV2_large | Inference Model/Training Model | 78.51 | 4.91 / 0.85 | 10.30 / 5.38 | 37.3 | |
| PP-LCNetV2_small | Inference Model/Training Model | 73.97 | 3.07 / 0.60 | 4.28 / 1.58 | 14.6 | |
| ResNet18_vd | Inference Model/Training Model | 72.3 | 2.87 / 0.77 | 7.91 / 4.64 | 41.5 | The ResNet series of models were introduced in 2015, winning the ILSVRC2015 competition with a top-5 error rate of 3.57%. This network innovatively proposed residual structures, which are stacked to construct the ResNet network. Experiments have shown that using residual blocks can effectively improve convergence speed and accuracy. |
| ResNet18 | Inference Model/Training Model | 71.0 | 2.63 / 0.74 | 6.30 / 4.16 | 41.5 | |
| ResNet34_vd | Inference Model/Training Model | 76.0 | 4.47 / 1.09 | 14.30 / 8.33 | 77.3 | |
| ResNet34 | Inference Model/Training Model | 74.6 | 4.20 / 1.07 | 12.53 / 7.83 | 77.3 | |
| ResNet50_vd | Inference Model/Training Model | 79.1 | 6.66 / 1.23 | 16.34 / 10.00 | 90.8 | |
| ResNet50 | Inference Model/Training Model | 76.5 | 6.25 / 1.17 | 15.93 / 9.72 | 90.8 | |
| ResNet101_vd | Inference Model/Training Model | 80.2 | 11.93 / 2.07 | 32.47 / 23.62 | 158.4 | |
| ResNet101 | Inference Model/Training Model | 77.6 | 13.73 / 2.06 | 29.69 / 17.72 | 158.4 | |
| ResNet152_vd | Inference Model/Training Model | 80.6 | 20.70 / 2.82 | 43.90 / 27.91 | 214.3 | |
| ResNet152 | Inference Model/Training Model | 78.3 | 17.86 / 2.79 | 46.19 / 26.00 | 214.2 | |
| ResNet200_vd | Inference Model/Training Model | 80.9 | 22.55 / 3.54 | 58.54 / 35.70 | 266.0 | |
| StarNet-S1 | Inference Model/Training Model | 73.6 | 6.24 / 0.96 | 8.78 / 2.44 | 11.2 | StarNet focuses on exploring the untapped potential of "star operations" (i.e., element-wise multiplication) in network design. It reveals that star operations can map inputs to high-dimensional, nonlinear feature spaces, a process akin to kernel tricks but without the need to expand the network size. Consequently, StarNet, a simple yet powerful prototype network, is further proposed, demonstrating exceptional performance and low latency under compact network structures and limited computational resources. |
| StarNet-S2 | Inference Model/Training Model | 74.8 | 4.78 / 0.85 | 7.24 / 2.48 | 14.3 | |
| StarNet-S3 | Inference Model/Training Model | 77.0 | 6.77 / 1.07 | 9.69 / 3.35 | 22.2 | |
| StarNet-S4 | Inference Model/Training Model | 79.0 | 9.01 / 1.48 | 14.79 / 4.58 | 28.9 | |
| SwinTransformer_base_patch4_window7_224 | Inference Model/Training Model | 83.37 | 13.04 / 10.77 | 133.79 / 118.45 | 340 | SwinTransformer is a novel vision Transformer network that can serve as a general-purpose backbone for computer vision tasks. SwinTransformer consists of a hierarchical Transformer structure represented by shifted windows. Shifted windows restrict self-attention computations to non-overlapping local windows while allowing cross-window connections, thereby enhancing network performance. |
| SwinTransformer_base_patch4_window12_384 | Inference Model/Training Model | 84.17 | 33.99 / 28.42 | 400.19 / 317.36 | 311.4 | |
| SwinTransformer_large_patch4_window7_224 | Inference Model/Training Model | 86.19 | 23.69 / 6.18 | 198.60 / 177.18 | 694.8 | |
| SwinTransformer_large_patch4_window12_384 | Inference Model/Training Model | 87.06 | 68.07 / 14.84 | 609.07 / 525.72 | 696.1 | |
| SwinTransformer_small_patch4_window7_224 | Inference Model/Training Model | 83.21 | 12.17 / 3.51 | 111.03 / 92.51 | 175.6 | |
| SwinTransformer_tiny_patch4_window7_224 | Inference Model/Training Model | 81.10 | 7.11 / 2.01 | 62.72 / 47.35 | 100.1 |
| Mode | GPU Configuration | CPU Configuration | Acceleration Technology Combination |
|---|---|---|---|
| Normal Mode | FP32 Precision / No TRT Acceleration | FP32 Precision / 8 Threads | PaddleInference |
| High-Performance Mode | Optimal combination of pre-selected precision types and acceleration strategies | FP32 Precision / 8 Threads | Pre-selected optimal backend (Paddle/OpenVINO/TRT, etc.) |
**Note:** Due to network issues, the above URL may not be accessible. If you need to access this link, please check the validity of the URL and try again. If the problem persists, it may be related to the link itself or the network connection.
Related methods, parameters, and explanations are as follows:
* `create_model` instantiates an image classification model (here, `PP-LCNet_x1_0` is used as an example), and the specific explanations are as follows:
| Parameter | Parameter Description | Parameter Type | Options | Default Value |
|---|---|---|---|---|
model_name |
Name of the model | str |
None | PP-LCNet_x1_0 |
model_dir |
Path to store the model | str |
None | None |
device |
The device used for model inference | str |
It supports specifying specific GPU card numbers, such as "gpu:0", other hardware card numbers, such as "npu:0", or CPU, such as "cpu". | gpu:0 |
use_hpip |
Whether to enable the high-performance inference plugin | bool |
None | False |
hpi_config |
High-performance inference configuration | dict | None |
None | None |
| Parameter | Parameter Description | Parameter Type | Options | Default Value |
|---|---|---|---|---|
input |
Data to be predicted, supporting multiple input types | Python Var/str/list |
|
None |
batch_size |
Batch size | int |
Any integer | 1 |
| Method | Method Description | Parameter | Parameter Type | Parameter Description | Default Value |
|---|---|---|---|---|---|
print() |
Print the results to the terminal | format_json |
bool |
Whether to format the output content using JSON indentation |
True |
indent |
int |
Specify the indentation level to beautify the output JSON data, making it more readable, only effective when format_json is True |
4 | ||
ensure_ascii |
bool |
Control whether to escape non-ASCII characters to Unicode. If set to True, all non-ASCII characters will be escaped; False retains the original characters, only effective when format_json is True |
False |
||
save_to_json() |
Save the results as a JSON file | save_path |
str |
The path to save the file. If it is a directory, the saved file name will be consistent with the input file name | None |
indent |
int |
Specify the indentation level to beautify the output JSON data, making it more readable, only effective when format_json is True |
4 | ||
ensure_ascii |
bool |
Control whether to escape non-ASCII characters to Unicode. If set to True, all non-ASCII characters will be escaped; False retains the original characters, only effective when format_json is True |
False |
||
save_to_img() |
Save the results as an image file | save_path |
str |
The path to save the file. If it is a directory, the saved file name will be consistent with the input file name | None |
| Attribute | Attribute Description |
|---|---|
json |
Get the prediction result in json format |
img |
Get the visualization image in dict format |
{
"done_flag": true,
"check_pass": true,
"attributes": {
"label_file": "dataset/label.txt",
"num_classes": 102,
"train_samples": 1020,
"train_sample_paths": [
"check_dataset/demo_img/image_01904.jpg",
"check_dataset/demo_img/image_06940.jpg"
],
"val_samples": 1020,
"val_sample_paths": [
"check_dataset/demo_img/image_01937.jpg",
"check_dataset/demo_img/image_06958.jpg"
]
},
"analysis": {
"histogram": "check_dataset/histogram.png"
},
"dataset_path": "cls_flowers_examples",
"show_type": "image",
"dataset_type": "ClsDataset"
}
The above validation results, with check_pass being True, indicate that the dataset format meets the requirements. Explanations for other indicators are as follows:
attributes.num_classes: The number of classes in this dataset is 102;attributes.train_samples: The number of training set samples in this dataset is 1020;attributes.val_samples: The number of validation set samples in this dataset is 1020;attributes.train_sample_paths: A list of relative paths to the visual samples in the training set of this dataset;attributes.val_sample_paths: A list of relative paths to the visual samples in the validation set of this dataset;Additionally, the dataset validation analyzes the sample number distribution across all classes in the dataset and generates a distribution histogram (histogram.png):

(1) Dataset Format Conversion
Image classification does not currently support data conversion.
(2) Dataset Splitting
The parameters for dataset splitting can be set by modifying the fields under CheckDataset in the configuration file. The following are example explanations for some of the parameters in the configuration file:
CheckDataset:split:enable: Whether to re-split the dataset. When set to True, the dataset format will be converted. The default is False;train_percent: If re-splitting the dataset, you need to set the percentage of the training set, which should be an integer between 0-100, ensuring that the sum with val_percent equals 100;For example, if you want to re-split the dataset with a 90% training set and a 10% validation set, you need to modify the configuration file as follows:
......
CheckDataset:
......
split:
enable: True
train_percent: 90
val_percent: 10
......
Then execute the command:
python main.py -c paddlex/configs/modules/image_classification/PP-LCNet_x1_0.yaml \
-o Global.mode=check_dataset \
-o Global.dataset_dir=./dataset/cls_flowers_examples
After the data splitting is executed, the original annotation files will be renamed to xxx.bak in the original path.
These parameters also support being set through appending command line arguments:
python main.py -c paddlex/configs/modules/image_classification/PP-LCNet_x1_0.yaml \
-o Global.mode=check_dataset \
-o Global.dataset_dir=./dataset/cls_flowers_examples \
-o CheckDataset.split.enable=True \
-o CheckDataset.split.train_percent=90 \
-o CheckDataset.split.val_percent=10
output. If you need to specify a save path, you can set it through the -o Global.output field in the configuration file.After completing the model training, all outputs are saved in the specified output directory (default is ./output/), typically including:
train_result.json: Training result record file, recording whether the training task was completed normally, as well as the output weight metrics, related file paths, etc.;
train.log: Training log file, recording changes in model metrics and loss during training;config.yaml: Training configuration file, recording the hyperparameter configuration for this training session;.pdparams, .pdema, .pdopt.pdstate, .pdiparams, .json: Model weight-related files, including network parameters, optimizer, EMA, static graph network parameters, static graph network structure, etc.;.json file) from protobuf(the former.pdmodel file) to be compatible with PIR and more flexible and scalable.When evaluating the model, you need to specify the model weight file path. Each configuration file has a default weight save path built-in. If you need to change it, simply set it by appending a command line parameter, such as -o Evaluate.weight_path=./output/best_model/best_model.pdparams.
After completing the model evaluation, an evaluate_result.json file will be generated, which records the evaluation results. Specifically, it records whether the evaluation task was completed successfully and the model's evaluation metrics, including val.top1, val.top5;