图像识别应用案例-看图识熊

【图像识别应用案例-看图识熊】using Microsoft.ML.OnnxRuntime; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data; using System.Drawing; using System.Linq;
using System.Numerics.Tensors; using System.Text;
using System.Threading.Tasks; using System.Windows.Forms;
namespace ClassifyBear{ public partial class Form1 :
Form { public Form1() {
InitializeComponent(); }
// 使用Netron查看模型,得到模型的输入应为224224大小的图片 private const int imageSize = 224;
private void button1_Click(object sender, EventArgs e) {
// 识别之前先重置界面显示的内容
label1.Text = string.Empty; pictureBox1.Image = null; pictureBox1.Refresh();
bool isSuccess = false; try { pictureBox1.Load(textBox1.Text); isSuccess = true; } catch (Exception ex) { MessageBox.Show($“读取图片时出现错误:{ex.Message}”); throw;

    推荐阅读