클라이언트 라이브러리를 사용하여 동영상에 주석 추가
이 빠른 시작에서는 Video Intelligence API를 소개합니다. 이 빠른 시작에서는 프로젝트 및 승인을 설정한 후 Google Cloud Video Intelligence에 동영상 주석을 작성하도록 요청합니다.
시작하기 전에
- 계정에 로그인합니다. Google Cloud 를 처음 사용하는 경우 Google Cloud, 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Cloud Video Intelligence API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Google Cloud CLI를 설치합니다.
-
외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.
gcloud init -
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Cloud Video Intelligence API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Google Cloud CLI를 설치합니다.
-
외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.
gcloud init
클라이언트 라이브러리 설치
Go
go get cloud.google.com/go/videointelligence/apiv1
Java
Maven을 사용하는 경우
다음 내용을 pom.xml 파일에 추가합니다. BOM에 대한 자세한 내용은
Google Cloud Platform 라이브러리 BOM을 참조하세요.
Visual Studio Code 또는 IntelliJ를 사용하는 경우 다음 IDE 플러그인을 사용하여 클라이언트 라이브러리를 프로젝트에 추가할 수 있습니다.
이 플러그인은 서비스 계정의 키 관리와 같은 추가 기능을 제공합니다. 자세한 내용은 각 플러그인의 문서를 참조하세요.
Node.js
라이브러리를 설치하기 전에 Node.js 개발을 위한 환경이 준비됐는지 확인하세요.
npm install @google-cloud/video-intelligence
Python
라이브러리를 설치하기 전에 Python 개발을 위한 환경이 준비됐는지 확인하세요.
pip install --upgrade google-cloud-videointelligence
추가 언어
C#: 클라이언트 라이브러리 페이지의 C# 설정 안내를 따른 다음 .NET용 Video Intelligence 참고 문서를 참조하세요.
PHP: 클라이언트 라이브러리 페이지의 PHP 설정 안내를 따른 다음 PHP용 Video Intelligence 참고 문서를 참조하세요.
Ruby: 클라이언트 라이브러리 페이지의 Ruby 설정 안내를 따른 다음 Ruby용 Video Intelligence 참고 문서를 참조하세요.
인증 설정
-
Google Cloud CLI를 설치합니다. 설치 후 Google Cloud CLI를 초기화하려면 다음 명령어를 실행합니다.
gcloud init외부 ID 공급업체 (IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
로컬 셸을 사용하는 경우 사용자 계정에 대한 로컬 인증 사용자 인증 정보를 만듭니다.
gcloud auth application-default login
Cloud Shell을 사용하는 경우 이 작업을 수행할 필요는 없습니다.
인증 오류가 반환되고 외부 ID 공급업체(IdP)를 사용하는 경우 제휴 ID로 gcloud CLI에 로그인했는지 확인합니다.
로그인 화면이 표시됩니다. 로그인하면 사용자 인증 정보는 ADC에서 사용하는 로컬 사용자 인증 정보 파일에 저장됩니다.
라벨 인식
이제 Video Intelligence API를 사용하여 동영상 또는 동영상 세그먼트에서 라벨 인식과 같이 정보를 요청할 수 있습니다. 다음 코드를 실행하여 첫 번째 동영상 라벨 인식 요청을 수행하세요.
Go
Java
Node.js
예시를 실행하기 전에 Node.js 개발 환경이 준비됐는지 확인합니다.
Python
예시를 실행하기 전에 Python 개발 환경이 준비됐는지 확인합니다.
추가 언어
C#: 클라이언트 라이브러리 페이지의 C# 설정 안내를 따른 다음 .NET용 Video Intelligence 참고 문서를 참조하세요.
PHP: 클라이언트 라이브러리 페이지의 PHP 설정 안내를 따른 다음 PHP용 Video Intelligence 참고 문서를 참조하세요.
Ruby: 클라이언트 라이브러리 페이지의 Ruby 설정 안내를 따른 다음 Ruby용 Video Intelligence 참고 문서를 참조하세요.
수고하셨습니다. 첫 번째 요청을 Video Intelligence API에 보냈습니다.
어땠나요?
삭제
이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.
- Google Cloud console 을 사용하여 필요 없는 프로젝트를 삭제합니다.