Skip to content

Commit

Permalink
fixed casing of property names
Browse files Browse the repository at this point in the history
  • Loading branch information
joreg committed Dec 21, 2023
1 parent 3020ade commit 424a14a
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 79 deletions.
2 changes: 0 additions & 2 deletions src/FaceDetectorResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ public class Facedetectorresults

public class FaceDescription
{
[JsonPropertyName("categories")]
public Category[] Categories { get; init; }
[JsonPropertyName("keypoints")]
public Keypoint[] Keypoints { get; init; }

//with .NET8 we'll be able to set the below to private and then jsoninclude
Expand Down
4 changes: 1 addition & 3 deletions src/FaceLandmarkResults.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json.Serialization;

namespace MediaPipe.FaceLandmarkResults
namespace MediaPipe.FaceLandmarkResults
{
public class FaceLandmarkRoot
{
Expand Down
60 changes: 32 additions & 28 deletions src/GestureResults.cs
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
namespace MediaPipe.GestureResults
{
public class Rootobject
public class GestureRoot
{
public Gestureresults gestureResults { get; set; }
public Resolution resolution { get; set; }
public Gestureresults GestureResults { get; set; }
public Resolution Resolution { get; set; }
}

public class Gestureresults
{
public Gesture[][] gestures { get; set; }
public Landmark[][] landmarks { get; set; }
public Worldlandmark[][] worldLandmarks { get; set; }
public Handedness[][] handedness { get; set; }
public Handedness1[][] handednesses { get; set; }
public Gesture[][] Gestures { get; set; }
public Landmark[][] Landmarks { get; set; }
public Worldlandmark[][] WorldLandmarks { get; set; }
public Handedness[][] Handedness { get; set; }
public Handedness1[][] Handednesses { get; set; }
}

public class Gesture
{
public float score { get; set; }
public int index { get; set; }
public string categoryName { get; set; }
public string displayName { get; set; }
public float Score { get; set; }
public int Index { get; set; }
public string CategoryName { get; set; }
public string DisplayName { get; set; }
}

public class Landmark
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
public float x { private get; init; }
public float y { private get; init; }
public float z { private get; init; }

public Vector3 Position { get { return new Vector3(x, y, z); } }
}

public class Worldlandmark
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
public float x { private get; init; }
public float y { private get; init; }
public float z { private get; init; }

public Vector3 Position { get { return new Vector3(x, y, z); } }
}

public class Handedness
{
public float score { get; set; }
public int index { get; set; }
public string categoryName { get; set; }
public string displayName { get; set; }
public float Score { get; set; }
public int Index { get; set; }
public string CategoryName { get; set; }
public string DisplayName { get; set; }
}

public class Handedness1
{
public float score { get; set; }
public int index { get; set; }
public string categoryName { get; set; }
public string displayName { get; set; }
public float Score { get; set; }
public int Index { get; set; }
public string CategoryName { get; set; }
public string DisplayName { get; set; }
}

public class Resolution
{
public int width { get; set; }
public int height { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
}
50 changes: 27 additions & 23 deletions src/HandResults.cs
Original file line number Diff line number Diff line change
@@ -1,52 +1,56 @@
namespace MediaPipe.HandResults
{
public class Rootobject
public class HandRoot
{
public Handresults handResults { get; set; }
public Resolution resolution { get; set; }
public Handresults HandResults { get; set; }
public Resolution Resolution { get; set; }
}

public class Handresults
{
public Landmark[][] landmarks { get; set; }
public Worldlandmark[][] worldLandmarks { get; set; }
public Handedness[][] handednesses { get; set; }
public Handedness1[][] handedness { get; set; }
public Landmark[][] Landmarks { get; set; }
public Worldlandmark[][] WorldLandmarks { get; set; }
public Handedness[][] Handednesses { get; set; }
public Handedness1[][] Handedness { get; set; }
}

public class Landmark
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
public float x { private get; init; }
public float y { private get; init; }
public float z { private get; init; }

public Vector3 Position { get { return new Vector3(x, y, z); } }
}

public class Worldlandmark
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
public float x { private get; init; }
public float y { private get; init; }
public float z { private get; init; }

public Vector3 Position { get { return new Vector3(x, y, z); } }
}

public class Handedness
{
public float score { get; set; }
public int index { get; set; }
public string categoryName { get; set; }
public string displayName { get; set; }
public float Score { get; set; }
public int Index { get; set; }
public string CategoryName { get; set; }
public string DisplayName { get; set; }
}

public class Handedness1
{
public float score { get; set; }
public int index { get; set; }
public string categoryName { get; set; }
public string displayName { get; set; }
public float Score { get; set; }
public int Index { get; set; }
public string CategoryName { get; set; }
public string DisplayName { get; set; }
}

public class Resolution
{
public int width { get; set; }
public int height { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
}
20 changes: 10 additions & 10 deletions src/ImageResults.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
namespace VL.MediaPipe.ImageResults
{
public class Rootobject
public class ImageRoot
{
public Imageresults imageResults { get; set; }
public Resolution resolution { get; set; }
public Imageresults ImageResults { get; set; }
public Resolution Resolution { get; set; }
}

public class Imageresults
{
public Classification[] classifications { get; set; }
public int timestampMs { get; set; }
public Classification[] Classifications { get; set; }
public int TimestampMs { get; set; }
}

public class Classification
{
public object[] categories { get; set; }
public int headIndex { get; set; }
public string headName { get; set; }
public object[] Categories { get; set; }
public int HeadIndex { get; set; }
public string HeadName { get; set; }
}

public class Resolution
{
public int width { get; set; }
public int height { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
}
28 changes: 15 additions & 13 deletions src/ObjectResults.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
namespace VL.MediaPipe.ObjectResults
{
public class Rootobject
public class ObjectRoot
{
public Objectresults objectResults { get; set; }
public Resolution resolution { get; set; }
public Objectresults ObjectResults { get; set; }
public Resolution Resolution { get; set; }
}

public class Objectresults
{
public Detection[] detections { get; set; }
public Detection[] Detections { get; set; }
}

public class Detection
{
public Category[] categories { get; set; }
public object[] keypoints { get; set; }
public Boundingbox boundingBox { get; set; }
public Category[] Categories { get; set; }
public object[] Keypoints { get; set; }
public Boundingbox boundingBox { private get; init; }

public Rectangle BoundingRect { get { return new Rectangle(boundingBox.originX, boundingBox.originY, boundingBox.width, boundingBox.height); } }
}

public class Boundingbox
Expand All @@ -29,15 +31,15 @@ public class Boundingbox

public class Category
{
public float score { get; set; }
public int index { get; set; }
public string categoryName { get; set; }
public string displayName { get; set; }
public float Score { get; set; }
public int Index { get; set; }
public string CategoryName { get; set; }
public string DisplayName { get; set; }
}

public class Resolution
{
public int width { get; set; }
public int height { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
}

0 comments on commit 424a14a

Please sign in to comment.