Closed GeorgeS2019 closed 1 month ago
Please provide a demo for this issue.
@Delsin-Yu @ZerxZ
protected void ShowResult(Image image, MediaPipeFaceLandmarkerResult result)
{
foreach (var tmplandmarks in result.FaceLandmarks)
{
//This step SLOW down the performance significantly <============
var landmarks = GDExtensionHelper.Bind<MediaPipeNormalizedLandmarks>(tmplandmarks.AsGodotObject());
DrawLandmarks(image, landmarks);
}
}
func show_result(image: Image, result: MediaPipeFaceLandmarkerResult) -> void:
for landmarks in result.face_landmarks:
draw_landmarks(image, landmarks)
func draw_landmarks(image: Image, landmarks: MediaPipeNormalizedLandmarks)
Review => the wrapper work. but performance is as PREVIOUSLY feedback => slow
https://github.com/Delsin-Yu/CSharp-Wrapper-Generator-for-GDExtension/issues/21
Please open a separate issue if you are mentioning another topic.
@Delsin-Yu
Do you have suggestion how to Bind
with better performance to get Godot.Collections.Array<MediaPipeNormalizedLandmarks>
=> in ONE STEP, so iteration can be avoided?
//This step SLOW down the performance significantly <============
var landmarks = GDExtensionHelper.Bind
public Godot.Collections.Array FaceLandmarks
{
get => (Godot.Collections.Array)Get("face_landmarks");
set => Set("face_landmarks", Variant.From(value));
}
@GeorgeS2019 Could you try this PR and see how it performs? https://github.com/Delsin-Yu/CSharp-Wrapper-Generator-for-GDExtension/pull/22#issue-2267635621
@Delsin-Yu
Do you have suggestion how to
Bind
with better performance to getGodot.Collections.Array<MediaPipeNormalizedLandmarks>
=> in ONE STEP, so iteration can be avoided?//This step SLOW down the performance significantly <============ var landmarks = GDExtensionHelper.Bind(tmplandmarks.AsGodotObject());
public Godot.Collections.Array FaceLandmarks { get => (Godot.Collections.Array)Get("face_landmarks"); set => Set("face_landmarks", Variant.From(value)); }
Let's move the discussion to the correct issue (#21) and continue it there.
https://github.com/j20001970/GDMP-demo/blob/3474994c3a844d935551c9793c8b642868105d2e/project/vision/face_landmarker/FaceLandmarker.gd#L37
The FaceLandMarks should returns
Godot.Collections.Array<MediaPipeNormalizedLandmarks>
The casting of Godot.Variant to MediaPipeNormalizedLandmarks does not work