diff --git a/docs/en/models/PP-HGNet_en.md b/docs/en/models/PP-HGNet_en.md index 3c664351ecba3855018a8d36eeae51fee4c22933..0184e1585506b8ccc5033a3d6c5f4392fed7d2e7 100644 --- a/docs/en/models/PP-HGNet_en.md +++ b/docs/en/models/PP-HGNet_en.md @@ -148,11 +148,18 @@ Predict complete! ```python from paddleclas import PaddleClas clas = PaddleClas(model_name='PPHGNet_small') -infer_imgs = 'docs/images/deployment/whl_demo.jpg' +infer_imgs = 'docs/images/inference_deployment/whl_demo.jpg' result = clas.predict(infer_imgs) print(next(result)) ``` +The result of demo above: + +``` +>>> result +[{'class_ids': [8, 7, 86, 82, 81], 'scores': [0.77132, 0.05122, 0.00755, 0.00199, 0.00115], 'label_names': ['hen', 'cock', 'partridge', 'ruffed grouse, partridge, Bonasa umbellus', 'ptarmigan'], 'filename': 'docs/images/inference_deployment/whl_demo.jpg'}] +``` + **Note**: The result returned by model.predict() is a `generator`, so you need to use the `next()` function to call it or `for loop` to loop it. And it will predict with batch_size size batch and return the prediction results when called. The default batch_size is 1, and you also specify the batch_size when instantiating, such as `model = paddleclas.PaddleClas(model_name="PPHGNet_small", batch_size=2)`. diff --git a/docs/en/models/PP-LCNet_en.md b/docs/en/models/PP-LCNet_en.md index 652af892b5681337fc8d8efa33bc032c9974bff6..d5786996d8d35e9eb50c837903b6ebd3d7b0e761 100644 --- a/docs/en/models/PP-LCNet_en.md +++ b/docs/en/models/PP-LCNet_en.md @@ -198,11 +198,18 @@ Predict complete! ```python from paddleclas import PaddleClas clas = PaddleClas(model_name='PPLCNet_x1_0') -infer_imgs = 'docs/images/deployment/whl_demo.jpg' +infer_imgs = 'docs/images/inference_deployment/whl_demo.jpg' result = clas.predict(infer_imgs) print(next(result)) ``` +The result of demo above: + +``` +>>> result +[{'class_ids': [8, 7, 86, 81, 85], 'scores': [0.91347, 0.03779, 0.0036, 0.00117, 0.00112], 'label_names': ['hen', 'cock', 'partridge', 'ptarmigan', 'quail'], 'filename': 'docs/images/inference_deployment/whl_demo.jpg'}] +``` + **Note**: The result returned by model.predict() is a `generator`, so you need to use the `next()` function to call it or `for loop` to loop it. And it will predict with batch_size size batch and return the prediction results when called. The default batch_size is 1, and you also specify the batch_size when instantiating, such as `model = paddleclas.PaddleClas(model_name="PPLCNet_x1_0", batch_size=2)`.