mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
Modify infer seg demo
This commit is contained in:
@@ -9,7 +9,7 @@ FastDeploy中各视觉模型可支持多种后端,包括
|
|||||||
所有模型切换后端方式均通过RuntimeOption进行切换,
|
所有模型切换后端方式均通过RuntimeOption进行切换,
|
||||||
|
|
||||||
**Python**
|
**Python**
|
||||||
```
|
```python
|
||||||
import fastdeploy as fd
|
import fastdeploy as fd
|
||||||
option = fd.RuntimeOption()
|
option = fd.RuntimeOption()
|
||||||
|
|
||||||
@@ -26,14 +26,14 @@ option.use_ort_backend() # ONNX Runtime
|
|||||||
```
|
```
|
||||||
|
|
||||||
**C++**
|
**C++**
|
||||||
```
|
```C++
|
||||||
fastdeploy::RuntimeOption option;
|
fastdeploy::RuntimeOption option;
|
||||||
|
|
||||||
# 切换使用CPU/GPU
|
// 切换使用CPU/GPU
|
||||||
option.UseCpu();
|
option.UseCpu();
|
||||||
option.UseGpu();
|
option.UseGpu();
|
||||||
|
|
||||||
# 切换不同后端
|
// 切换不同后端
|
||||||
option.UsePaddleBackend(); // Paddle Inference
|
option.UsePaddleBackend(); // Paddle Inference
|
||||||
option.UseTrtBackend(); // TensorRT
|
option.UseTrtBackend(); // TensorRT
|
||||||
option.UseOpenVINOBackend(); // OpenVINO
|
option.UseOpenVINOBackend(); // OpenVINO
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 模型版本说明
|
## 模型版本说明
|
||||||
|
|
||||||
- [PaddleSeg Release/2.6](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.6)
|
- [PaddleSeg develop](https://github.com/PaddlePaddle/PaddleSeg/tree/develop)
|
||||||
|
|
||||||
目前FastDeploy支持如下模型的部署
|
目前FastDeploy支持如下模型的部署
|
||||||
|
|
||||||
|
@@ -83,8 +83,11 @@ void TrtInfer(const std::string& model_dir, const std::string& image_file) {
|
|||||||
auto option = fastdeploy::RuntimeOption();
|
auto option = fastdeploy::RuntimeOption();
|
||||||
option.UseGpu();
|
option.UseGpu();
|
||||||
option.UseTrtBackend();
|
option.UseTrtBackend();
|
||||||
|
<<<<<<< HEAD
|
||||||
// option.SetTrtInputShape("x", {1, 3, 256, 256}, {1, 3, 1024, 1024},
|
// option.SetTrtInputShape("x", {1, 3, 256, 256}, {1, 3, 1024, 1024},
|
||||||
// {1, 3, 2048, 2048});
|
// {1, 3, 2048, 2048});
|
||||||
|
=======
|
||||||
|
>>>>>>> 4de832bc37b1f9c44e4956db94c2605cd34e021b
|
||||||
auto model = fastdeploy::vision::segmentation::PaddleSegModel(
|
auto model = fastdeploy::vision::segmentation::PaddleSegModel(
|
||||||
model_file, params_file, config_file, option);
|
model_file, params_file, config_file, option);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user