PaddlePaddle / PaddlePaddle/FastDeploy

编译paddleseg infer.cs,没推理结果

Open
#1,853 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.7k
Forks
756
Avg merge
19h 28m
Merged PRs (30d)
4

Description

环境

  • 【FastDeploy版本】: 说明具体的版本,如fastdeploy-linux-gpu-1.0.4
  • 【编译命令】自行编译C# API
  • cmake .. -G "Visual Studio 16 2019" -A x64 -DENABLE_ORT_BACKEND=ON -DENABLE_PADDLE_BACKEND=ON -DENABLE_OPENVINO_BACKEND=ON -DENABLE_VISION=ON -DWITH_GPU=ON -DENABLE_TEXT=ON -DWITH_CAPI=ON -DWITH_CSHARPAPI=ON -DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy_CUDA_csharp" -DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" -DTRT_DIRECTORY="E:\work\tools\TensorRT-8.5.2.2.Windows10.x86_64.cuda-11.8.cudnn8.6\TensorRT-8.5.2.2"
  • 【系统平台】: Windows x64(Windows10)
  • 【硬件】: 说明具体硬件型号,如 Nvidia GPU 3060, CUDA 11.2 CUDNN 8.4
  • 【编译语言】: C#

修改了OpenCvSharp版本4.7.0.20230115为4.4.2.0.20200108,以对应net4.0版本,编译成功C# API

编译E:\work\tools\fastdeploy-win-x64-gpu-1.0.4\examples\vision\segmentation\paddleseg\cpu-gpu\csharp中的infer.cs 使用以下方法:

1、vs2019 创建控制台应用.net framework新项目D:\paddleseg_csharp\paddleseg_demo_gpu,选择net4.0版本
将E:\work\tools\fastdeploy-win-x64-gpu-1.0.4\examples\vision\segmentation\paddleseg\cpu-gpu\csharp中的infer.cs代码拷贝到D:\paddleseg_csharp\paddleseg_demo_gpu infer.cs
2、下载opencvsharp4.2.0.20200108版本,和编译fastdeploy_csharp API一致,添加引用,引用编译好的fastdeploy_csharp
3、设置配置管理器:release x64,生成paddle_demo.exe.
4、将所有dll拷贝到可执行程序同目录,fastdeploy_init.bat install %cd% D:\paddleseg_csharp\paddleseg_demo_gpu\bin\x64\Release
5、运行paddleseg_demo_gpu PP_LiteSeg_B_STDC2_cityscapes_without_argmax_infer cityscapes_demo.png 0

执行没报错,但没显示推理结果;改代码为Cv2.ImWrite("result.jpg", res_img);也未保存结果

be6d01a40e7968de0e7f051e882090e

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/vision/segmentation/paddleseg/cpu-gpu/csharp/infer.cs and reproduce the reported command using PP_LiteSeg_B_STDC2_cityscapes_without_argmax_infer and cityscapes_demo.png. Compare the execution path with the reported Cv2.ImWrite("result.jpg", res_img) attempt; the issue is resolved when the segmentation result is visibly produced or saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.