mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00
[C#] Add c# api for ppseg models (#1398)
* add c# api for ppseg * add example * fix according to test * update interface * fix destroy funcs
This commit is contained in:
@@ -50,6 +50,17 @@ public class Visualize {
|
||||
return new Mat(result_ptr);
|
||||
}
|
||||
|
||||
public static Mat VisSegmentation(Mat im,
|
||||
SegmentationResult segmentation_result,
|
||||
float weight = 0.5f){
|
||||
FD_SegmentationResult fd_segmentation_result =
|
||||
ConvertResult.ConvertSegmentationResultToCResult(segmentation_result);
|
||||
IntPtr result_ptr =
|
||||
FD_C_VisSegmentation(im.CvPtr, ref fd_segmentation_result,
|
||||
weight);
|
||||
return new Mat(result_ptr);
|
||||
}
|
||||
|
||||
|
||||
[DllImport("fastdeploy.dll", EntryPoint = "FD_C_VisDetection")]
|
||||
private static extern IntPtr
|
||||
@@ -62,6 +73,10 @@ public class Visualize {
|
||||
FD_C_VisDetectionWithLabel(IntPtr im, ref FD_DetectionResult fd_detection_result,
|
||||
ref FD_OneDimArrayCstr labels,
|
||||
float score_threshold, int line_size, float font_size);
|
||||
|
||||
[DllImport("fastdeploy.dll", EntryPoint = "FD_C_VisSegmentation")]
|
||||
private static extern IntPtr
|
||||
FD_C_VisSegmentation(IntPtr im, ref FD_SegmentationResult fd_segmentation_result, float weight);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user