אם עוד לא יצרתם Google Cloud פרויקט, אתם יכולים ליצור אחד. כדי לראות את ההוראות, אפשר להרחיב את הקטע הזה.
נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud,
צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Roles required to select or create a project
Select a project: Selecting a project doesn't require a specific
IAM role—you can select any project that you've been
granted a role on.
Create a project: To create a project, you need the Project Creator role
(roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloudinit
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Roles required to select or create a project
Select a project: Selecting a project doesn't require a specific
IAM role—you can select any project that you've been
granted a role on.
Create a project: To create a project, you need the Project Creator role
(roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloudinit
זיהוי מאפייני תמונה בתמונה מקומית
אתם יכולים להשתמש ב-Vision API כדי לבצע זיהוי תכונות בקובץ תמונה מקומי.
בבקשות REST, שולחים את תוכן קובץ התמונה כמחרוזת מקודדת ב-Base64 בגוף הבקשה.
בבקשות של gcloud וספריות לקוח, מציינים את הנתיב לתמונה מקומית בבקשה.
השדה ColorInfo
לא מכיל מידע על מרחב הצבעים המוחלט שצריך לשמש לפרשנות של ערך ה-RGB (למשל, sRGB, Adobe RGB, DCI-P3, BT.2020 וכו'). כברירת מחדל, האפליקציות צריכות להניח שמרחב הצבעים הוא sRGB.
REST
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
BASE64_ENCODED_IMAGE: ייצוג base64 (מחרוזת ASCII) של נתוני התמונה הבינאריים. המחרוזת הזו צריכה להיראות כמו המחרוזת הבאה:
RESULTS_INT: (אופציונלי) ערך של מספר שלם של תוצאות להחזרה. אם משמיטים את השדה "maxResults" ואת הערך שלו, ה-API מחזיר את ערך ברירת המחדל של 10 תוצאות. השדה הזה לא רלוונטי לסוגי התכונות הבאים:
TEXT_DETECTION, DOCUMENT_TEXT_DETECTION או CROP_HINTS.
PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
ה-method של ה-HTTP וכתובת ה-URL:
POST https://vision.googleapis.com/v1/images:annotate