Logo Roboflow Custom Weights Upload

Roboflow Custom Weights Upload

Tổ chức
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.

Tổng quan

Nhà phát hànhroboflow
Kho mãcomputer-vision-skills
Tên kỹ năngroboflow-custom-weights-upload
Sao
50
Bản fork
11
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được roboflow công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Roboflow Custom Weights Upload trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/roboflow/computer-vision-skills/tree/main/skills/roboflow-custom-weights-upload
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Roboflow Custom Weights Upload trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Roboflow Custom Weights Upload ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Roboflow Custom Weights Upload với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

Câu hỏi thường gặp

Kỹ năng AI Roboflow Custom Weights Upload làm được gì?

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.

Vì sao nên dùng Roboflow Custom Weights Upload trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Roboflow Custom Weights Upload là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Roboflow Custom Weights Upload trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/roboflow/computer-vision-skills/tree/main/skills/roboflow-custom-weights-upload. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Roboflow Custom Weights Upload?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Roboflow Custom Weights Upload với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Roboflow Custom Weights Upload với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Roboflow Custom Weights Upload có miễn phí không?

Có. Kỹ năng này được roboflow phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇