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

Error extracting metadata from video. #34

Open
disl opened this issue Nov 6, 2024 · 0 comments
Open

Error extracting metadata from video. #34

disl opened this issue Nov 6, 2024 · 0 comments

Comments

@disl
Copy link

disl commented Nov 6, 2024

Error occurs when ‘yolo.RunObjectDetection’ is executed.

Code:

private void startToolStripMenuItem_Click(object sender, EventArgs e)
{
    try
    {
        //////////
        // VIDEO
        //////////
        // Instantiate a new Yolo object
        using var yolo = new Yolo(new YoloOptions
        {
            OnnxModel = @"yolov8s.onnx",      // Your Yolov8 or Yolov10 model in onnx format
            ModelType = ModelType.ObjectDetection,  // Set your model type
            Cuda = false,                           // Use CPU or CUDA for GPU accelerated inference. Default = true
            GpuId = 0,                               // Select Gpu by id. Default = 0
            PrimeGpu = false,                       // Pre-allocate GPU before first. Default = false                
        });

        // Set video options
        var options = new VideoOptions
        {
            VideoFile = @"C:\Users\DSluzki\Desktop\video.mp4",
            OutputDir = @"C:\Users\DSluzki\Desktop\YoloOutput",
            //GenerateVideo = false,
            //DrawLabels = true,
            //FPS = 30,
            //Width = 640,  // Resize video...
            //Height = -2,  // -2 automatically calculate dimensions to keep proportions
            //Quality = 28,
            //DrawConfidence = true,
            //KeepAudio = true,
            //KeepFrames = false,
            //DrawSegment = DrawSegment.Default,
            //PoseOptions = MyPoseMarkerConfiguration // Your own pose marker configuration...
        };

        // Run inference on video
        var results = yolo.RunObjectDetection(options, 0.25, 0.7);

        // Do further processing with 'results'...

    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}
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

1 participant