Skip to content

Custom Model Setup #71

@alessiopierdominici

Description

@alessiopierdominici

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions