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

yolo.Predict 方法错误 System.IndexOutOfRangeException:“Index was outside the bounds of the array.” #7

Closed
LiuCodeDream opened this issue Jan 11, 2023 · 1 comment

Comments

@LiuCodeDream
Copy link

        using var yolo = new Yolov7("./Assets/yolov7_training.onnx");
        yolo.SetupYoloDefaultLabels();
        //yolo.SetupLabels(new string[] { "OilBarrel", "FaceShield", "jacket", "trousers", "boots", "shoes", "glove", "safety_hat" });
        Assert.NotNull(yolo);

        using var image = System.Drawing.Image.FromFile("Assets/demo.jpg");
        var ret = yolo.Predict(image);
        Assert.NotNull(ret);
        Assert.True(ret.Count == 1);
@iwaitu
Copy link
Collaborator

iwaitu commented Jan 16, 2023

The labels count in your onnx file is less than the length was setup in your setuplabel function

@iwaitu iwaitu closed this as completed May 28, 2023
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