检测效果如下 (模型数据集为 MVTecDataset 的 bottle 类):

模型信息如下:

界面设计 (Form2.Designer.cs)
using System.Drawing;
using System.Windows.Forms;
using System;
namespace yolo_world_opencvsharp_net4._8
{
partial class Form2
{
private System.ComponentModel.IContainer components = null;
private PictureBox originalImageBox;
private PictureBox anomalyMapBox;
private PictureBox predMaskBox;
private Button loadImageButton;
private Button inferenceButton;
private Label scoreLabel;
private Label labelLabel;
private ProgressBar progressBar;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private ()
{
.originalImageBox = System.Windows.Forms.PictureBox();
.anomalyMapBox = System.Windows.Forms.PictureBox();
.predMaskBox = System.Windows.Forms.PictureBox();
.loadImageButton = System.Windows.Forms.Button();
.inferenceButton = System.Windows.Forms.Button();
.scoreLabel = System.Windows.Forms.Label();
.labelLabel = System.Windows.Forms.Label();
.progressBar = System.Windows.Forms.ProgressBar();
.elapsedTimeLabel = System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(.originalImageBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(.anomalyMapBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(.predMaskBox)).BeginInit();
.SuspendLayout();
.originalImageBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
.originalImageBox.Location = System.Drawing.Point(, );
.originalImageBox.Name = ;
.originalImageBox.Size = System.Drawing.Size(, );
.originalImageBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
.originalImageBox.TabIndex = ;
.originalImageBox.TabStop = ;
.anomalyMapBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
.anomalyMapBox.Location = System.Drawing.Point(, );
.anomalyMapBox.Name = ;
.anomalyMapBox.Size = System.Drawing.Size(, );
.anomalyMapBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
.anomalyMapBox.TabIndex = ;
.anomalyMapBox.TabStop = ;
.predMaskBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
.predMaskBox.Location = System.Drawing.Point(, );
.predMaskBox.Name = ;
.predMaskBox.Size = System.Drawing.Size(, );
.predMaskBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
.predMaskBox.TabIndex = ;
.predMaskBox.TabStop = ;
.loadImageButton.Location = System.Drawing.Point(, );
.loadImageButton.Name = ;
.loadImageButton.Size = System.Drawing.Size(, );
.loadImageButton.TabIndex = ;
.loadImageButton.Text = ;
.loadImageButton.Click += System.EventHandler(.LoadImageButton_Click);
.inferenceButton.Enabled = ;
.inferenceButton.Location = System.Drawing.Point(, );
.inferenceButton.Name = ;
.inferenceButton.Size = System.Drawing.Size(, );
.inferenceButton.TabIndex = ;
.inferenceButton.Text = ;
.inferenceButton.Click += System.EventHandler(.InferenceButton_Click);
.scoreLabel.Location = System.Drawing.Point(, );
.scoreLabel.Name = ;
.scoreLabel.Size = System.Drawing.Size(, );
.scoreLabel.TabIndex = ;
.scoreLabel.Text = ;
.labelLabel.Location = System.Drawing.Point(, );
.labelLabel.Name = ;
.labelLabel.Size = System.Drawing.Size(, );
.labelLabel.TabIndex = ;
.labelLabel.Text = ;
.progressBar.Location = System.Drawing.Point(, );
.progressBar.Name = ;
.progressBar.Size = System.Drawing.Size(, );
.progressBar.TabIndex = ;
.progressBar.Visible = ;
.elapsedTimeLabel.AutoSize = ;
.elapsedTimeLabel.Location = System.Drawing.Point(, );
.elapsedTimeLabel.Name = ;
.elapsedTimeLabel.Size = System.Drawing.Size(, );
.elapsedTimeLabel.TabIndex = ;
.elapsedTimeLabel.Text = ;
.AutoScaleDimensions = System.Drawing.SizeF(, );
.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
.ClientSize = System.Drawing.Size(, );
.Controls.Add(.elapsedTimeLabel);
.Controls.Add(.originalImageBox);
.Controls.Add(.anomalyMapBox);
.Controls.Add(.predMaskBox);
.Controls.Add(.loadImageButton);
.Controls.Add(.inferenceButton);
.Controls.Add(.scoreLabel);
.Controls.Add(.labelLabel);
.Controls.Add(.progressBar);
.Name = ;
.Text = ;
((System.ComponentModel.ISupportInitialize)(.originalImageBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(.anomalyMapBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(.predMaskBox)).EndInit();
.ResumeLayout();
.PerformLayout();
}
Label elapsedTimeLabel;
}
}


