界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

serving

serving

【开发与工程】Use this YOLOv5 sub-skill for the Flask REST API example, request validation, API-key handling, client payloads, and safe service smoke checks.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: serving description: "Use this YOLOv5 sub-skill for the Flask REST API example, request validation, API-key handling, client payloads, and safe service smoke checks." disable-model-invocation: true metadata: disco-role: operating license: AGPL 3.0

YOLOv5 Flask Serving

Use this route for the repository's Flask REST API example: utils/flask_rest_api/restapi.py, its request payloads, API-key behavior, upload validation, and safe smoke testing.

Choose the workflow

  • Plan a request or server: read references/workflows.md for route shape, image upload behavior, client request structure, and server startup considerations.
  • Inspect the API contract: read references/api-reference.md for the route, model name, upload limit, file-type checks, and JSON response shape.
  • Check the service safely: run scripts/rest_api_smoke.py to exercise the Flask test client with a dummy model instead of starting a server or downloading weights.

Common decisions

  • The route expects an image upload under the image form field.
  • Set API_KEY only when you need authenticated requests; send the matching X-API-Key header.
  • The server allows only a small set of image extensions and a 16 MB upload cap.
  • The bundled example server loads YOLOv5 models through PyTorch Hub when actually started; that can download weights.
  • The smoke helper avoids network, weight downloads, and a live listener.

Handoffs

  • Route detection behavior questions to ../detection/SKILL.md.
  • Route export/deployment-format questions to ../export/SKILL.md.
  • Read root references/troubleshooting.md for upload, auth, and service-side failure surfaces.
我的收藏