A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://paddlepaddle.github.io/PaddleX/latest/pipeline_usage/instructions/pipeline_python_API.html below:

PaddleX产线Python脚本使用说明 - PaddleX 文档

PaddleX模型产线Python脚本使用说明

在使用 Python 脚本进行模型产线快速推理前,请确保您已经按照 PaddleX 本地安装教程完成了 PaddleX 的安装。

一、使用示例

以图像分类产线为例,使用方式如下:

from paddlex import create_pipeline
pipeline = create_pipeline("image_classification")
output = pipeline.predict("https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_image_classification_001.jpg", batch_size=1, topk=5)
for res in output:
    res.print(json_format=False)
    res.save_to_img("./output/")
    res.save_to_json("./output/res.json")

简单来说,只需三步:

二、API说明 1. 调用create_pipeline()方法实例化预测模型产线对象 2. 调用预测模型产线对象的predict()方法进行推理预测 3. 对预测结果进行可视化

模型产线的预测结果支持访问、可视化及保存,可通过相应的属性或方法实现,具体如下:

属性: 方法: 4. 推理后端设置

PaddleX 支持通过PaddlePredictorOption修改推理配置,相关API如下:

属性: 方法: 2025年8月14日 2025年8月14日 cuicheng01

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4