url: https://travelnoire.com/best-carnival-celebrations-around-the-world/, pageTitle: Best \u003cb\u003eCarnival\u003c/b\u003e Celebrations Around The World - Travel Noire, fullMatchingImages: [{url: https://travelnoire.com/wp-content/uploads/2019/02/quinten-de-graaf-278848-unsplash.jpg}]
url: https://bespokebrazil.com/rio-carnival-2019/, pageTitle: Visit \u003cb\u003eRio Carnival 2019\u003c/b\u003e with the Brazil Specialists - Bespoke Brazil, partialMatchingImages: [{ url: https://bespoke-brazil-2018-bespokebrazil.netdna-ssl.com/wp-content/uploads/2019/01/Carnival-1.jpg}]
Configura il progetto Google Cloud e l'autenticazione
Se non hai creato un Google Cloud progetto, fallo ora. Espandi questa sezione per visualizzare le istruzioni.
Accedi al tuo account Google Cloud . Se non conosci
Google Cloud,
crea un account per valutare le prestazioni dei nostri prodotti in
scenari reali. I nuovi clienti ricevono anche 300 $di crediti senza costi per l'esecuzione, il test e il deployment dei workload.
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.
Per inizializzare gcloud CLI, esegui questo comando:
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.
Per inizializzare gcloud CLI, esegui questo comando:
gcloudinit
Rilevare entità web con un'immagine locale
Puoi utilizzare l'API Vision per eseguire il rilevamento delle funzionalità su un file immagine locale.
Per le richieste REST, invia i contenuti del file immagine come stringa con codifica base64 nel corpo della richiesta.
Per le richieste gcloud e delle librerie client, specifica il percorso di un'immagine locale nella tua richiesta.
REST
Prima di utilizzare i dati della richiesta, apporta le sostituzioni seguenti:
BASE64_ENCODED_IMAGE: La rappresentazione
in base64 (stringa ASCII) dei dati dell'immagine binaria. Questa stringa dovrebbe essere simile alla
seguente:
RESULTS_INT: (facoltativo) un valore intero dei risultati da restituire. Se ometti il campo "maxResults" e il relativo valore, l'API restituisce il valore predefinito
di 10 risultati. Questo campo non si applica ai seguenti tipi di funzionalità:
TEXT_DETECTION, DOCUMENT_TEXT_DETECTION o CROP_HINTS.
PROJECT_ID: l'ID progetto Google Cloud .
Metodo HTTP e URL:
POST https://vision.googleapis.com/v1/images:annotate
// detectWeb gets image properties from the Vision API for an image at the given file path.funcdetectWeb(wio.Writer,filestring)error{ctx:=context.Background()client,err:=vision.NewImageAnnotatorClient(ctx)