Roboflow Custom Weights Upload 标志

Roboflow Custom Weights Upload

组织
roboflow
roboflow-custom-weights-upload

Use when uploading locally trained model weights (YOLO, RF-DETR, YOLO-NAS, PaliGemma, Florence-2) to Roboflow — the client-side Python SDK upload flow, safe API key handling, per-family packaging requirements, and verifying the upload.

概览

发布者roboflow
代码仓库computer-vision-skills
技能名称roboflow-custom-weights-upload
星标数
50
复刻数
11
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 roboflow 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Roboflow Custom Weights Upload AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/roboflow/computer-vision-skills/tree/main/skills/roboflow-custom-weights-upload
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roboflow/computer-vision-skills.git /tmp/computer-vision-skills
mkdir -p .claude/skills
cp -r /tmp/computer-vision-skills/skills/roboflow-custom-weights-upload .claude/skills/roboflow-custom-weights-upload
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Roboflow Custom Weights Upload,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Roboflow Custom Weights Upload。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Roboflow Custom Weights Upload 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

For agents: This skill is authored in roboflow/computer-vision-skills. If your client already has it loaded as a skill (for example from a Roboflow plugin), use that copy. The skill://roboflow/<name>/SKILL.md MCP resources serve the same skills for clients that don't have them loaded.

Custom Weights Upload

Register weights from a model trained outside Roboflow (a laptop, a training server, Colab) so Roboflow can convert, host, and serve it.

Where the upload runs

Packaging reads the checkpoint from disk, so the upload always runs on the machine that has the weights — client-side, with the Python SDK flow below.

The models_custom_weights_upload_guide MCP tool is a guide, not an uploader: calling it returns this recipe and echoes back the arguments you passed (its upload_mode field says whether they describe a versioned or a workspace upload, or undetermined when they pin down neither). It never packages or uploads anything, because the MCP server cannot read the user's filesystem.

Client-side upload with the Python SDK

Run this on the machine that has the weights, ideally in the same Python environment used for training (it already has torch and the matching ultralytics).

  1. Install the SDK: both roboflow>=1.3.13 and rfdetr require Python >= 3.10; check python3 --version first (macOS ships 3.9). If it is too old, create a venv: uv venv --python 3.12 && source .venv/bin/activate. Then pip install "roboflow>=1.3.13".

  2. Handle the API key safely: never ask the user to paste a private API key into chat, and never scan dotfiles, shell profiles, or config files hunting for one — permission systems rightly block that. If ROBOFLOW_API_KEY is already set in the environment (test -n "$ROBOFLOW_API_KEY") or the working project has a .env that defines it, use it. Otherwise mint a scoped key with the MCP api_keys_create tool — it returns the secret once (api_keys_roll is the only other tool that does; api_keys_list / api_keys_get return masked metadata) — and write it yourself to a .gitignore'd .env as ROBOFLOW_API_KEY. Writing .env does not populate os.environ: load it before running. For a .env you just wrote yourself, set -a; source .env; set +a is fine. For a pre-existing .env, never source it — sourcing executes any shell in the file and exports every other secret it holds into the process. Read only the one key instead, e.g. with python-dotenv (pip install python-dotenv) in the script:

    python
    import os
    from dotenv import dotenv_values
    
    os.environ["ROBOFLOW_API_KEY"] = dotenv_values(".env")["ROBOFLOW_API_KEY"]

    Scope the key for the whole deploy flow, not minimally: the SDK's rf.workspace() reads the workspace and its project list before deploying, so project:read plus model:deploy alone fails with missing permissions. Include workspace:read, project:read, model:deploy, and for a versioned deploy also version:read and version:update. Getting the scopes right at mint time is what protects the upload: the preflight below only confirms the key and the workspace read, not the deploy scope.

    If the api_keys_create call is denied (permission systems may flag credential creation during an upload task) or unavailable, do not work around the denial. Ask the user to choose: (a) explicitly authorize minting a temporary scoped key, which you revoke with api_keys_revoke after the upload; (b) set ROBOFLOW_API_KEY themselves in their shell or a .env; or (c) point you at an existing .env that already defines it.

  3. Confirm the destination and the name with the user: registering a model is not easily undone. Never infer the target project or version from the checkpoint's class count or filename — ask. The same goes for model_name on a workspace upload: ask the user what the model should be called; do not invent a name.

Preflight before packaging

Packaging plus a 100 MB+ upload is slow; run the cheap checks first and report every gap at once instead of failing one step at a time:

  1. Python is >= 3.10 (python3 --version).

  2. Required imports load: torch for YOLO, RF-DETR, and YOLO-NAS; ultralytics for YOLO v8/v10/v11/v12/26; rfdetr>=1.8.0 for raw PyTorch-Lightning RF-DETR checkpoints.

  3. The key is valid and covers the workspace read — one cheap call that exercises the same workspace/project-list read deploy_model starts with:

    python
    import os
    from roboflow import Roboflow
    
    Roboflow(api_key=os.environ["ROBOFLOW_API_KEY"]).workspace()

    Be honest about the limit of this check: it does not exercise model:deploy, which the platform only tests at models/prepareUpload, after packaging. That is why step 2 mints the key with the full scope set up front — the preflight catches a bad or under-read key, not a missing deploy scope on an existing key.

Only package and upload after all three pass.

Workspace model upload (no dataset version required):

python
import os
from roboflow import Roboflow

rf = Roboflow(api_key=os.environ["ROBOFLOW_API_KEY"])
workspace = rf.workspace("WORKSPACE_SLUG")
workspace.deploy_model(
    model_type="rfdetr-base",
    model_path="/path/to/training/output",
    project_ids=["PROJECT_SLUG"],
    model_name="MODEL_NAME",
    filename="checkpoint_best_total.pth",  # relative to model_path
)

Versioned deploy (attach weights to an existing dataset version):

python
import os
from roboflow import Roboflow

rf = Roboflow(api_key=os.environ["ROBOFLOW_API_KEY"])
version = rf.workspace("WORKSPACE_SLUG").project("PROJECT_SLUG").version(3)
version.deploy(
    model_type="yolov8n",
    model_path="/path/to/runs/detect/train",
    filename="weights/best.pt",
)

model_type must name the real architecture (yolov8n, yolov11s, rfdetr-base, rfdetr-seg-medium, yolonas, a supported PaliGemma or Florence-2 type). For YOLO families the SDK infers a missing size suffix from the weights; RF-DETR accepts no bare rfdetr — pass the exact variant, which the SDK cross-checks against the checkpoint.

On a size/variant or dependency mismatch, deploy_model / version.deploy print the error and then interactively prompt "Would you like to continue anyway? y/n" — in a headless run the prompt surfaces as an EOFError right after the printed error. Recover by error type:

  • Size/variant mismatch: when the error names the type that fits, fix model_type to it and rerun; when it says the size could not be inferred, pass an explicit size.
  • Dependency mismatch: the error names a pip pin, not a model type (yolov8 recommends ultralytics==8.0.196, so most current training environments hit this prompt). Install the named version, or — only with the user's explicit confirmation — answer y (headless: printf 'y\n' | python upload.py) to continue with the installed version.

Never force past either prompt without the user explicitly confirming the override is intentional.

Per-family requirements

  • YOLO v8/v10/v11/v12/YOLO26: needs torch and ultralytics importable (yolov8 recommends ultralytics==8.0.196; see the dependency-mismatch note above). Legacy YOLO v5/v7/v9: needs torch plus an opt.yaml in model_path with imgsz (or img_size) and batch_size; ultralytics is not used. There is no yolov6 support.
  • RF-DETR: needs torch to read the checkpoint. If a class_names.txt (one class per line) sits in model_path it is used; otherwise class names come from the checkpoint's args. Raw PyTorch-Lightning checkpoints additionally need rfdetr>=1.8.0 installed (the SDK's error names the exact minimum if yours is older). An explicit filename that does not exist is a hard error; the default weights/best.pt falls back to the first top-level .pt/.pth file, with a warning.
  • YOLO-NAS: model_type="yolonas" plus an opt.yaml in model_path with imgsz, batch_size, and architecture.
  • PaliGemma / Florence-2: model_path is the Hugging Face save directory (config, tokenizer, and weights files); no torch needed.

Verify the upload

Conversion runs server-side after the upload and usually takes a few minutes. Check it with the MCP models_list / models_get tools or at app.roboflow.com/WORKSPACE/PROJECT/models, then run a test inference on a sample image to confirm classes and predictions look right.

常见问题

Roboflow Custom Weights Upload AI 技能有什么作用?

Use when uploading locally trained model weights (YOLO, RF-DETR, YOLO-NAS, PaliGemma, Florence-2) to Roboflow — the client-side Python SDK upload flow, safe API key handling, per-family packaging requirements, and verifying the upload.

为什么在 TypingMind 中使用 Roboflow Custom Weights Upload?

因为您只需安装一次,就能搭配任何模型使用。Roboflow Custom Weights Upload 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Roboflow Custom Weights Upload?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/roboflow/computer-vision-skills/tree/main/skills/roboflow-custom-weights-upload。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Roboflow Custom Weights Upload?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Roboflow Custom Weights Upload 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Roboflow Custom Weights Upload 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Roboflow Custom Weights Upload AI 技能免费吗?

是的。roboflow 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇