mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00
[C#] Supplement model and result api for c sharp (#1322)
* add c sharp api for fastdeploy * update accroding to c apis * add cmakelist for c sharp api * add cmakelists for c sharp * fix cmakelists * fix cmakelists * add c sharp api for fastdeploy * add ppyoloe demo * add ppyoloe demo * modify demo namespace code * add readme * fix format * format code * fix doc * add model api * add batch_predict and string result for c sharp * add ppdet models * update api * fix
This commit is contained in:
@@ -35,10 +35,34 @@ public class Visualize {
|
||||
return new Mat(result_ptr);
|
||||
}
|
||||
|
||||
|
||||
public static Mat VisDetection(Mat im, DetectionResult detection_result,
|
||||
string[] labels,
|
||||
float score_threshold = 0.0f,
|
||||
int line_size = 1, float font_size = 0.5f) {
|
||||
FD_DetectionResult fd_detection_result =
|
||||
ConvertResult.ConvertDetectionResultToCResult(detection_result);
|
||||
FD_OneDimArrayCstr labels_in = ConvertResult.ConvertStringArrayToCOneDimArrayCstr(labels);
|
||||
IntPtr result_ptr =
|
||||
FD_C_VisDetectionWithLabel(im.CvPtr, ref fd_detection_result,
|
||||
ref labels_in, score_threshold,
|
||||
line_size, font_size);
|
||||
return new Mat(result_ptr);
|
||||
}
|
||||
|
||||
|
||||
[DllImport("fastdeploy.dll", EntryPoint = "FD_C_VisDetection")]
|
||||
private static extern IntPtr
|
||||
FD_C_VisDetection(IntPtr im, ref FD_DetectionResult fd_detection_result,
|
||||
float score_threshold, int line_size, float font_size);
|
||||
|
||||
|
||||
[DllImport("fastdeploy.dll", EntryPoint = "FD_C_VisDetectionWithLabel")]
|
||||
private static extern IntPtr
|
||||
FD_C_VisDetectionWithLabel(IntPtr im, ref FD_DetectionResult fd_detection_result,
|
||||
ref FD_OneDimArrayCstr labels,
|
||||
float score_threshold, int line_size, float font_size);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user