{
  "schemaVersion": 1,
  "id": "3.2.2",
  "title": "手写数字识别系统交互流程设计",
  "durationMinutes": 20,
  "category": "代码实现与交互设计",
  "scenario": "手写数字识别系统是在数字化转型和自动化需求日益增长的社会背景下应运而生的。随着信息时代的到来，大量手写文档需要进行电子化处理，以提高数据存储、检索和分析的效率。传统的光学字符识别(OCR)技术在处理手写体时面临诸多挑战，如书写风格的多样性、笔迹的连笔和重叠等，导致识别率不高。然而，深度学习的兴起，尤其是卷积神经网络(CNN)的发展，为手写数字的精准识别提供了强大的工具。\n\nAI模型说明：提供的模型“mnist.onnx”是基于卷积神经网络训练得到的，专门用于进行手写数字的识别应用。该模型的使用交互流程为：\n\n1)加载模型“mnist.onnx”;\n\n2)加载一张本地手写数字图片“img_test.png”，并进行预处理图像以符合模型输入要求；\n\n3)使用mnist模型对手写数字图片进行识别；\n\n4)输出识别后的数字。\n\n你作为一名人工智能训练师，请完成以下工作任务：\n\n（1）补全该模型的使用交互流程对应的Python代码（3.2.2.ipynb），实现本地测试图片“img_test.png”的识别，将其识别结果截图保存为jpg格式文件，命名为3.2.2-1.jpg。\n\n（2）在上面的使用交互流程基础上，给出在手写数字识别系统中使用“mnist.onnx”模型的一种人机交互的最优流程，将其保存为docx文件，命名为3.2.2.docx。",
  "skillRequirements": "（1）能够确保模型在单一场景下稳定运行；\n\n（2）能通过分析，设计单一场景下人工和智能交互的最优流程。",
  "qualityIndicators": "（1）模型运行稳定，使用正常；\n\n（2）单一场景下人工和智能交互的最优流程切实可行。",
  "tasks": [
    {
      "id": "code-fill",
      "type": "code-fill",
      "title": "补全代码任务",
      "instructions": "依据公开题面和附件补全代码空位；仅检查完成度与提交格式，不公开标准内容。",
      "codeBlocks": [
        "import onnxruntime\nimport numpy as np\nfrom PIL import Image\n\n\n# 加载ONNX模型  2分\nort_session = __________________\n\n\n# 加载图像 2分\nimage = __________________('L')  # 转为灰度图\n\n\n#图像预处理 \nimage = __________________((28, 28))  # 调整大小为MNIST模型的输入尺寸2分\nimage_array = __________________(__________________, dtype=np.float32)  # 转为numpy数组2分\nimage_array = __________________(__________________, axis=0)  # 添加batch维度2分\nimage_array = __________________(__________________, axis=0)  # 添加通道维度2分\n\n\n#返回模型输入列表 2分\nort_inputs = {__________________()[0].name: image_array}\n# 执行预测 2分\nort_outs = __________________(None, ort_inputs)\n\n\n# 获取预测结果 2分\npredicted_class = __________________\n\n\n# 输出预测结果\nprint(f\"Predicted class: {predicted_class}\")\n"
      ],
      "blanks": [
        {
          "id": "blank-1",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-2",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-3",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-4",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-5",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-6",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-7",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-8",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-9",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-10",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-11",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        },
        {
          "id": "blank-12",
          "block": 1,
          "placeholder": "__________________",
          "gradingMode": "completion-and-format-only"
        }
      ]
    },
    {
      "id": "3-2-response",
      "type": "rubric-response",
      "title": "交互方案设计",
      "instructions": "说明代码功能对应的人机交互流程。",
      "sections": [
        {
          "id": "response",
          "label": "作答内容"
        }
      ],
      "rubric": [
        {
          "id": "criterion-1",
          "label": "输入与格式校验清晰",
          "weight": 25
        },
        {
          "id": "criterion-2",
          "label": "执行进度和状态反馈完整",
          "weight": 25
        },
        {
          "id": "criterion-3",
          "label": "结果展示可理解",
          "weight": 25
        },
        {
          "id": "criterion-4",
          "label": "包含异常处理与人工确认",
          "weight": 25
        }
      ]
    },
    {
      "id": "artifact-submission",
      "type": "artifact-submission",
      "title": "选择结果文件",
      "instructions": "文件仅在本机选择并校验，不上传，也不持久化文件内容。",
      "items": [
        {
          "id": "artifact-1",
          "label": "提交文件：3.2.2-1.jpg",
          "filename": "3.2.2-1.jpg",
          "extensions": [
            ".jpg"
          ],
          "minCount": 1,
          "maxCount": 1,
          "maxSize": 104857600
        },
        {
          "id": "artifact-2",
          "label": "提交文件：3.2.2.docx",
          "filename": "3.2.2.docx",
          "extensions": [
            ".docx"
          ],
          "minCount": 1,
          "maxCount": 1,
          "maxSize": 104857600
        }
      ]
    }
  ],
  "attachments": [
    {
      "name": "3.2.2.docx",
      "url": "assets/3.2.2/3.2.2.docx",
      "size": 14593,
      "sha256": "077ba5fd6ce50dae13fc1ce2f5b47cfaf5bd7421bc738679458b6c5cde7c5fa2",
      "mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    },
    {
      "name": "3.2.2.ipynb",
      "url": "assets/3.2.2/3.2.2.ipynb",
      "size": 1768,
      "sha256": "0fbe1e7ca06dc3604268887020fec32e5e879e0fdc24210b2a83cd48a06497ee",
      "mime": "application/x-ipynb+json"
    },
    {
      "name": "3.2.2.md",
      "url": "assets/3.2.2/3.2.2.md",
      "size": 2148,
      "sha256": "6e887f0132b2c49718704566bc6b184b0344dc67bd0add27bd2aced476f41e0b",
      "mime": "text/markdown"
    },
    {
      "name": "img_test.png",
      "url": "assets/3.2.2/img_test.png",
      "size": 16753,
      "sha256": "85dbd75a5b0c81491ddeae785cd208f4084b608bcd8b27deca87e3e6be473606",
      "mime": "image/png"
    },
    {
      "name": "mnist.onnx",
      "url": "assets/3.2.2/mnist.onnx",
      "size": 26143,
      "sha256": "5c688690f8bacf667d4c2074af5ad0646ca328d7ab03eccf944a65b320171bdd",
      "mime": "application/octet-stream"
    }
  ],
  "grading": {
    "mode": "completion-and-format-only"
  },
  "review": {
    "status": "approved",
    "notice": "由公开题面通用生成，未使用答案树。",
    "conflicts": []
  },
  "contentVersion": "8e86544bfc704461"
}
