Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

Meta のロゴ

detr-resnet-50

ベータ

物体検出 • Meta

Markdown で表示Agent セットアップ
  • Cloudflare ホスト

COCO 2017 の物体検出(注釈付き画像 11.8 万枚)でエンドツーエンドに学習した DEtection TRansformer(DETR)モデルです。

モデル情報
ベータはい
単価$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"

パラメーター

オプション 1
stringformat: binary
検出に使う画像です
type
array
contentType
application/json
description
An array of detected objects within the input image
items
[object Object]

API スキーマ(Raw)

Input
Output

役に立ちましたか?