Pular para o conteúdo
Meta logo

detr-resnet-50

Beta

Object Detection • Meta

Ver como Markdown
  • Cloudflare-hosted

DEtection TRansformer (DETR) model trained end-to-end on COCO 2017 object detection (118k annotated images).

Model Info
BetaYes
Unit Pricing$0.0000075 per inference request

Usage


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"

Parameters

Option 1
stringformat: binary
The image to use for detection
type
array
contentType
application/json
description
An array of detected objects within the input image
items
[object Object]

API Schemas (Raw)

Input
Output