Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Model Setup #71

Open
EXINEF opened this issue Aug 19, 2022 · 2 comments
Open

Custom Model Setup #71

EXINEF opened this issue Aug 19, 2022 · 2 comments

Comments

@EXINEF
Copy link

EXINEF commented Aug 19, 2022

Hello guys, I am new to these libraries, I have problems with the C# sharp file to config the custom model, probably I have set up bad the Anchors, Strides, and other stuff cause I did not understand how to set up those values.

This is the Class that extends the abstract Class YoloModel and I will load my model as file:

public class Class1 : YoloModel
{
public override int Width { get; set; } = 640;

    public override int Height { get; set; } = 640;


    public override int Depth { get; set; } = 3;


    public override int Dimensions { get; set; } = 10;


    public override int[] Strides { get; set; } = new int[3] { 8, 16, 32 };

FLOW_CONTROL_1

    public override int[][][] Anchors { get; set; } = new int[3][][]
    {
        new int[3][]
        {
            new int[2] { 10, 13 },
            new int[2] { 16, 30 },
            new int[2] { 33, 23 }
        },
        new int[3][]
        {
            new int[2] { 30, 61 },
            new int[2] { 62, 45 },
            new int[2] { 59, 119 }
        },
        new int[3][]
        {
            new int[2] { 116, 90 },
            new int[2] { 156, 198 },
            new int[2] { 373, 326 }
        }
    };


    public override int[] Shapes { get; set; } = new int[3] { 80, 40, 20 };


    public override float Confidence { get; set; } = 0.2f;


    public override float MulConfidence { get; set; } = 0.25f;


    public override float Overlap { get; set; } = 0.45f;


    public override string[] Outputs { get; set; } = new string[1] { "output" };


    public override List<YoloLabel> Labels { get; set; } = new List<YoloLabel>
    {
        new YoloLabel
        {
            Id = 1,
            Name = "c22_ok"
        },
        new YoloLabel
        {
            Id = 2,
            Name = "c22_wrong"
        },
        new YoloLabel
        {
            Id = 3,
            Name = "c23_ok"
        },
        new YoloLabel
        {
            Id = 4,
            Name = "c23_wrong"
        }
    };


    public override bool UseDetect { get; set; } = true;

FLOW_CONTROL_1
}

@Jcrueger
Copy link

Jcrueger commented Aug 21, 2022

Your stride is going to be 8,16,32 shapes are gonna be 80,40,20 and dimensions are gonna be how many Labels you have +5 which in your case looks to be 9

@EXINEF
Copy link
Author

EXINEF commented Aug 23, 2022

I didn't understand why those values but thank you so much for helping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants