임베디드 보드(Jetson)에 Google Assistant 설치하기

참고

구글 클라우드 플랫폼 가입은 참고 링크의 첫번째 블로그를 선행하여 진행한다.

이후 내용은 Jetson TX2에서 Google Assistant SDK를 설치 한 후 동작 확인한 내용을 다룬다.

의존패키지 설치

$ sudo apt-get install portaudio19-dev libffi-dev libssl-dev
$ sudo apt-get install python3-dev python3-venv

python 가상환경 만들기

$ python3 -m venv py3
$ py3/bin/python -m pip install --upgrade pip setuptools

Google Assistant SDK 설치

$ source py3/bin/activate
$ python -m pip install --upgrade google-assistant-sdk[samples]
$ python -m pip install --upgrade google-auth-oauthlib[tool]

Credential 생성

$ google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless --client-secrets client_secret_생략.apps.googleusercontent.com.json

Credential 생성 시 사용할 프로젝트 ID값은 구글 클라우드 플랫폼 사이트에서 확인할 수 있다.

디바이스 등록

$ googlesamples-assistant-devicetool --project-id "프로젝트ID" register-model --manufacturer "DIY co." --product-name "TestGA" --description "my own google assistant" --type LIGHT --model "Jetson"

디바이스 등록 확인

$ googlesamples-assistant-devicetool --project-id "프로젝트ID" list --model
Device Model ID: Jetson
        Project ID: dev-monolith-227508
        Device Type: action.devices.types.LIGHT
No traits

기본 동작 확인

$ googlesamples-assistant-pushtotalk --project-id "프로젝트ID" --device-id "Jetson" --lang ko-KR

위와 같이 실행하면 다음과 같은 결과를 확인 가능하다.

INFO:root:Connecting to embeddedassistant.googleapis.com
INFO:root:Using device model Jetson and device id b610dd2e-0f3d-11e9-af93-00044b8cc2e0
Press Enter to send a new request...
INFO:root:Recording audio request.
INFO:root:Transcript of user request: "안녕".
INFO:root:Transcript of user request: "은영아".
INFO:root:Transcript of user request: "안녕 하세".
INFO:root:Transcript of user request: "안녕하세요".
INFO:root:Transcript of user request: "안녕하세요".
INFO:root:End of audio request detected.
INFO:root:Stopping recording.
INFO:root:Transcript of user request: "안녕하세요".
INFO:root:Playing assistant response.
INFO:root:Finished playing assistant response.
Press Enter to send a new request...

Leave a Reply