跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com
Meta logo

detr-resnet-50

Beta

Object Detection • Meta

查看 MarkdownAgent 设置
  • Cloudflare-hosted

DEtection TRansformer(DETR)模型,基于 COCO 2017 目标检测数据集(11.8 万张标注图像)进行端到端训练。

模型信息
Beta是
单位定价$0.0000075 per inference request

用法


export interface Env {
  AI: Ai;
}

export default {
  async fetch(request, env): Promise<Response> {
    const res = await fetch("https://cataas.com/cat");
    const blob = await res.arrayBuffer();

    const inputs = {
      image: [...new Uint8Array(blob)],
    };

    const response = await env.AI.run(
      "@cf/facebook/detr-resnet-50",
      inputs
    );

    return new Response(JSON.stringify({ inputs: { image: [] }, response }));
  },
} satisfies ExportedHandler<Env>;

curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/facebook/detr-resnet-50  \
    -X POST  \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"  \
    --data-binary "@pedestrian-boulevard-manhattan-crossing.jpg"

参数

Option 1
stringformat: binary
用于检测的图像
type
array
contentType
application/json
description
在输入图像中检测到的目标数组
items
[object Object]

API schema(原始)

输入
输出

这篇文档对您有帮助吗?