זיהוי פנים בתמונה

מצייר תיבות סביב הפנים שזוהו בתמונה.

המשך למידה

לקבלת הסבר מפורט שכולל את דוגמת הקוד הזו, קראו את המאמר:

דוגמת קוד

Java

מידע על התקנת ספריית הלקוח של Vision API Google Product Search והשימוש בה מופיע במאמר ספריות הלקוח של Vision API Google Product Search. מידע נוסף מופיע במאמרי העזרה של Vision API Product Search Java API.

כדי לבצע אימות ב-Vision API Google Product Search, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/** Connects to the Vision API using Application Default Credentials. */
public static Vision getVisionService() throws IOException, GeneralSecurityException {
  GoogleCredentials credential =
      GoogleCredentials.getApplicationDefault().createScoped(VisionScopes.all());
  JsonFactory jsonFactory = GsonFactory.getDefaultInstance();
  return new Vision.Builder(
          GoogleNetHttpTransport.newTrustedTransport(),
          jsonFactory,
          new HttpCredentialsAdapter(credential))
      .setApplicationName(APPLICATION_NAME)
      .build();
}

Node.js

מידע על התקנת ספריית הלקוח של Vision API Google Product Search והשימוש בה מופיע במאמר ספריות הלקוח של Vision API Google Product Search. מידע נוסף מופיע במאמרי העזרה של Vision API Product Search Node.js API.

כדי לבצע אימות ב-Vision API Google Product Search, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// Creates a client
const client = new vision.ImageAnnotatorClient();

const fs = require('fs');

PHP

מידע על התקנת ספריית הלקוח של Vision API Google Product Search והשימוש בה מופיע במאמר ספריות הלקוח של Vision API Google Product Search.

כדי לבצע אימות ב-Vision API Google Product Search, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

$imageAnnotator = new ImageAnnotatorClient();

Python

מידע על התקנת ספריית הלקוח של Vision API Google Product Search והשימוש בה מופיע במאמר ספריות הלקוח של Vision API Google Product Search. מידע נוסף מופיע במאמרי העזרה של Vision API Product Search Python API.

כדי לבצע אימות ב-Vision API Google Product Search, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

client = vision.ImageAnnotatorClient()

המאמרים הבאים

כדי לחפש ולסנן דוגמאות קוד למוצרים אחרים של Google Cloud , אפשר להיעזר בGoogle Cloud דפדפן לדוגמה.