-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Video Intelligence: Qwik Start
- Loading branch information
1 parent
086eb2c
commit ee2e124
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
gcloud services enable videointelligence.googleapis.com | ||
gcloud iam service-accounts create quickstart | ||
gcloud iam service-accounts keys create key.json --iam-account quickstart@$DEVSHELL_PROJECT_ID.iam.gserviceaccount.com | ||
gcloud auth activate-service-account --key-file key.json | ||
gcloud auth print-access-token | ||
cat > request.json <<EOF | ||
{ | ||
"inputUri":"gs://spls/gsp154/video/train.mp4", | ||
"features": [ | ||
"LABEL_DETECTION" | ||
] | ||
} | ||
EOF | ||
|
||
export RESPONSE=$(curl -s -H 'Content-Type: application/json' -H 'Authorization: Bearer '$(gcloud auth print-access-token)'' 'https://videointelligence.googleapis.com/v1/videos:annotate' -d @request.json | jq -r '.name') | ||
curl -s -H 'Content-Type: application/json' \ | ||
-H 'Authorization: Bearer '$(gcloud auth print-access-token)'' \ | ||
'https://videointelligence.googleapis.com/v1/$RESPONSE' |