Upgrade to Pro — share decks privately, control downloads, hide ads and more …

20240926 顔を検出する

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for saka saka
December 23, 2025
3

20240926 顔を検出する

Avatar for saka

saka

December 23, 2025

Transcript

  1. const detectFromImage = async () => { const endpoint =

    "https://tatsuya-face.cognitiveservices.azure.com/"; const apikey = "7c7ee600133d40e48f6adb40011c5ab1"; const credential = new AzureKeyCredential(apikey); const client = createFaceClient(endpoint, credential); const filename = "data/01.jpg"; const response = await client.path("/detect").post({ contentType: "application/octet-stream", queryParameters: { detectionModel: "detection_03", recognitionModel: "recognition_04", returnFaceLandmarks: true, returnRecognitionModel: true, faceIdTimeToLive: 120, returnFaceAttributes: ["headPose", "mask", "qualityForRecognition"], returnFaceId: false, }, body: readFileSync(filename), }); if (isUnexpected(response)) { throw new Error(response.body.error.message); } console.log(`Detect from image: ${filename}`); console.log(JSON.stringify(response.body, null, 2)); };
  2. ෼ੳ݁Ռ Detect from image: data/01.jpg [ { "faceRectangle": { "top":

    233, "left": 703, "width": 381, "height": 485 }, "faceLandmarks": { "pupilLeft": { "x": 771.4, "y": 416.6 }, "pupilRight": { "x": 938.3, "y": 408.6