5. Host path에서 Browser를 눌러서 Host PC 공유 폴더 설정에서 작업한 폴더 경로를 여기서 동일하게 선택하면 된다. Name은 원하는 이름으로 설정하면 된다. 그리고 Next를 누른다.
6. Enable this share의 체크박스에 체크를 하고 Finish 버튼을 눌러 종료 한다.
7. OK 버튼을 눌러 설정을 모두 마무리 한다.
우분투 구동 후 설정
1. 로그인 하기 전에, 우분투를 구동 시킨 탭에서 오른쪽 클릭 후 Reinstall VMware Tools를 선택한다.
2. 화면 하단에 로그인을 하고 virtual CD drive를 Mount하고 Terminal을 띄워서 tar로 압축 파일을 풀은 후 vmware-install.pl 파일을 실행하라는 문구가 화면 하단에 뜬다. 이것을 확인하고 로그인을 한다.
3. 로그인 후 파일 탐색기를 열면 CD drive에 VMware Tools가 Mount가 되어 있고, 그곳에 VMwareTools-10.3.10-13959562.tar.gz이 존재하는 것을 확인 할 수 있다. 바로 이 tar.gz 파일을 압축을 풀어야 한다.
4. Terminal을 실행하여 다음과 같은 경로를 타고 tar.gz 파일이 있는 곳 까지 이동을 하여, 압축을 해제한다.
mskim@ubuntu:~$ cd ..
mskim@ubuntu:/home$ cd ..
mskim@ubuntu:/$ cd media
mskim@ubuntu:/media$ ls
floppy floppy0 mskim
mskim@ubuntu:/media$ cd mskim
mskim@ubuntu:/media/mskim$ ls
VMware Tools
mskim@ubuntu:/media/mskim$ cd VMware\ Tools
mskim@ubuntu:/media/mskim/VMware Tools$ ls
manifest.txt VMwareTools-10.3.10-13959562.tar.gz vmware-tools-upgrader-64
run_upgrader.sh vmware-tools-upgrader-32
mskim@ubuntu:/media/mskim/VMware Tools$ cp VMwareTools-10.3.10-13959562.tar.gz ~/.
mskim@ubuntu:/media/mskim/VMware Tools$ cd ~
mskim@ubuntu:~$ ls
Desktop
Documents
Downloads
examples.desktop
gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf
gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf.tar.xz
Music
Pictures
Public
Templates
u-boot
Videos
VMwareTools-10.3.10-13959562.tar.gz
mskim@ubuntu:~$ tar xzf VMwareTools-10.3.10-13959562.tar.gz
mskim@ubuntu:~$ ls
Desktop
Documents
Downloads
examples.desktop
gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf
gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf.tar.xz
Music
Pictures
Public
Templates
u-boot
Videos
VMwareTools-10.3.10-13959562.tar.gz
vmware-tools-distrib
mskim@ubuntu:~$ cd vmware-tools-distrib
mskim@ubuntu:~/vmware-tools-distrib$ ls
bin caf doc etc FILES INSTALL installer lib vgauth vmware-install.pl
5. vmware-install.pl 파일을 위에서 제일 마지막에 확인 할 수 있었다. 이것을 쉘로 실행을 한다. 실행 후 중간 중간 Yes/No를 입력하거나 또는 경로를 입력을 해주어야 한다. 본인은 모두 Yes로 했던거 같고, 경로는 예제로 나와있는 경로와 동일하게 입력을 하였다.
mskim@ubuntu:~/vmware-tools-distrib$ sudo ./vmware-install.pl
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
Packages must be removed with the --purge option.
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes] yes
INPUT: [yes]
Creating a new VMware Tools installer database using the tar4 format.
Installing VMware Tools.
In which directory do you want to install the binary files?
[/usr/bin] /usr/bin
INPUT: [/usr/bin]
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc] /etc
INPUT: [/etc]
What is the directory that contains the init scripts?
[/etc/init.d] /etc/init.d
INPUT: [/etc/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin] /ure/sbin
INPUT: [/ure/sbin]
The path "/ure/sbin" does not exist currently. This program is going to create
it, including needed parent directories. Is this what you want? [yes] no
INPUT: [no]
In which directory do you want to install the daemon files?
[/usr/sbin] /usr/sbin
INPUT: [/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware-tools] /usr/lib/vmware-tools
INPUT: [/usr/lib/vmware-tools]
The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes] yes
INPUT: [yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools] /usr/share/doc/vmware-tools
INPUT: [/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes] yes
INPUT: [yes]
The installation of VMware Tools 10.3.10 build-13959562 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] yes
INPUT: [yes]
You have chosen to install VMware Tools on top of an open-vm-tools package.
You will now be given the option to replace some commands provided by
open-vm-tools. Please note that if you replace any commands at this time and
later remove VMware Tools, it may be necessary to re-install the open-vm-tools.
The file /usr/bin/vmware-hgfsclient that this program was about to install
already exists. Overwrite? [no] yes
INPUT: [yes]
The file /sbin/mount.vmhgfs that this program was about to install already
exists. Overwrite? [no] yes
INPUT: [yes]
The file /usr/bin/vmhgfs-fuse that this program was about to install already
exists. Overwrite? [no] yes
INPUT: [yes]
Initializing...
Making sure services for VMware Tools are stopped.
Stopping VMware Tools services in the virtual machine:
VMware User Agent (vmware-user): done
Unmounting HGFS shares: done
Guest filesystem driver: done
The module vmci has already been installed on this system by another installer
or package and will not be modified by this installer.
The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.
The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.
The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.
The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.
The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment. Do you wish
to enable this feature? [yes] yes
INPUT: [yes]
The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
Skipping configuring automatic kernel modules as no drivers were installed by
this installer.
Skipping rebuilding initrd boot image for kernel as no drivers to be included
in boot image were installed by this installer.
The configuration of VMware Tools 10.3.10 build-13959562 for Linux for this
running kernel completed successfully.
Enjoy,
--the VMware team
mskim@ubuntu:~/vmware-tools-distrib$
이제 모든 설정은 완료가 되었다.
Host PC인 Win10에서 공유 폴더 확인 하기
공유 폴더는 처음에 "Host PC에서 공유 폴더 설정" 부분에서 우리가 설정했던 공유 폴더가 되겠다.
VMware의 우분투에서 공유 폴더 확인 하기
공유 폴더는 다음과 같이 "Computer → mnt → hgfs" 안에 우리가 이전에 "VMware에서 공유펄더 설정" 항목에서 "우분투 구동 전 설정" 부분의 5번 항목에서 공유 폴더이름을 만들었던 그 이름 그대로 폴더가 존재하는 것을 알수 있다.
여기서 추가로, 이 경로까지 들어오기가 만만하지 않기 때문에 이 폴더를 Desktop 폴더로 복사하도록 하겠다.
GiGA Genie AI Makers Kit을 이용하기 위한 Python 3버전 소스 코드입니다.
1. Prerequisites
Python 3.x를 지원하며 아래 Python 라이브러리 추가 설치가 필요합니다.
gRPC
PyAudio
GiGA Genie 음성호출어('기가지니', '지니야' 등) 이용을 위해 GiGA Genie에서 제공하는 shared library와 Python extension이 필요합니다.
libkwscmdapi.so (Raspberry Pi용)
ktkws Python extension module
2. Quick Start
a) 사용자 인증정보 받기
AI Makers Kit 이용을 위해서는 KT APILINK 사이트에서 개발자 등록 후
인증정보(clientid, client key, clientsecret)를 먼저 발급 받아야 합니다.
b) Python3 버전 추가 라이브러리 설치
$ sudo easy_install3 pip
$ sudo easy_install3 install/ktkws-1.0.1-py3.5-linux-armv7l.egg
$ sudo apt install portaudio19-dev
$ sudo pip3 install grpcio grpcio-tools
$ sudo pip3 install pyaudio
c) 사용자 인증 정보 입력
[user_auth.py 파일에 인증정보 입력]
아래 정보를 기가지니 포털에서 발급 받은 클라이언트 키 정보로 업데이트 하세요.
[client]
clientid: YOUR_CLIENT_ID
clientkey: YOUR_CLIENT_KEY
clientsecret: YOUR_CLIENT_SECRET
d) 예제 실행(ex1 ~ ex9)
$ python3 ex1_kwstest.py
3. Usage
a) 기본이 되는 단위 기능별 사용 예제
ex1) 음성 호출(Keyword Spotting) 이용(code 참조)
import ktkws
ktkws.init(KWSMODELDATA) # ../data/kwsmodel.pack 이용
ktkws.start()
ktkws.set_keyword(KWSID) # 0: 기가지니, 1: 지니야(default), 2: 친구야, 3: 자기야
ktkws.detect(AUDIOSTERAM) # AUDIOSTREAM: PCM 16000Hz, mono, LINEAR16 LE
# ktkws.detect() return value가 1이면 detect
ex2-6) 음성인식/대화/음성합성 API 이용(code 참조)
gRPC 서비스 정의 : ../data/gigagenieRPC.proto
API
getVoice2Text : 음성인식(Speech-to-text)
getText2VoiceUrl : 음성합성(Text-to-speech) wave file url로 전달
getText2VoiceStream : 음성합성(TTS)을 stream data로 전달
queryByText : Text에 대한 대화해석 결과(기가지니 Dialog Kit 참조)
queryByVoice : STT한 결과에 대한 대화해석 결과(기가지니 Dialog Kit 참조)
ex7-9) 복합 예제(음성/대화/TTS/Button)
기타) 기능파일
user_auth.py : 사용자 인증 구현
MicrophoneStream.py : 마이크 스트림 구현
b) gkit을 이용한 예제
sample_keyword.py : 음성호출을 이용한 음성인식/음성합성 이용 예제
sample_button.py : 버튼을 이용한 음성인식/음성합성 이용 예제
sample_led.py : 다양한 애니메이션 효과를 준 LED 이용 예제
main_demo.py : 음성호출/버튼을 함계 이용한 음성인식/음성합성 이용 예제(LED 사용 포함)
sample_keyword.py
# gkit 모듈 준비
import gkit
# KWS 모델데이터를 준비
gkit.kws_start()
# 음성호출에 사용할 키워드 세팅: 지니야(default), 기가지니, 친구야, 자기야
gkit.kws_setkeyword('기가지니')
# kws_detect() 리턴값이 1 이면 음성 호출어가 감지된 것임
if gkit.kws_detect() == 1:
print ('detected')
sample_button.py
import gkit
# 버튼이 눌러졌을 때 실행되는 callback
def callback():
print ("Button was pressed")
# 버튼 생성 후 callback 등록
gkit.get_button().on_press(callback)
sample_led.py
import gkit
# LED 객체 생성
led = gkit.get_led()
# LED로 나타낼 상태 애니메이션 설정
led.set_state(gkit.LED.BLINK)
"""
사용 가능한 LED 상태 값
gkit.LED.OFF
gkit.LED.ON
gkit.LED.BLINK
gkit.LED.BLINK_3
gkit.LED.BEACON
gkit.LED.BEACON_DARK
gkit.LED.DECAY
gkit.LED.PULSE_SLOW
gkit.LED.PULSE_QUICK
"""
main_demo.py
import gkit
# 음성호출이나 버튼이 눌러졌을 때 실행되는 callback
def myservice():
""" Do something: your service ... """
# for example : Speech-to-text
stt_text = gkit.getVoice2Text()
# 클라이언트 키 정보 설정
gkit.set_clientkey(CLIENT_ID, CLIENT_KEY, CLIENT_SECRET)
# Detector 객체 생성(음성호출, 버튼에 대한 detection 처리)
detector = gkit.KeywordDetector()
try:
detector.start(callback = myservice)
except:
detector.terminate()
Enjoy with AI Makers Kit !
예제를 실행하기 전에 다음과 같이 위의 md 파일의 설명 중에 하기 1번 항목에 대해서 먼저 작업이 필요하다.
1. Prerequisites
Python 3.x를 지원하며 아래 Python 라이브러리 추가 설치가 필요합니다.
gRPC
PyAudio
GiGA Genie 음성호출어('기가지니', '지니야' 등) 이용을 위해 GiGA Genie에서 제공하는 shared library와 Python extension이 필요합니다.
libkwscmdapi.so (Raspberry Pi용)
ktkws Python extension module
즉, 설명과 같이 libkwscmdapi.so와 ktkws Python extension module 라이브러리를 설치해야 한다.
그런데 어떻게 설치하는지에 대한 설명이 없다.... !!!
그래서 일단 2번의 하기 항목을 먼저 실행한다. 우선, ai-makers-kit-master\python3 폴더에서 다음의 명령어를 실행한다.
b) Python3 버전 추가 라이브러리 설치
$ sudo easy_install3 pip
$ sudo easy_install3 install/ktkws-1.0.1-py3.5-linux-armv7l.egg
$ sudo apt install portaudio19-dev
$ sudo pip3 install grpcio grpcio-tools
$ sudo pip3 install pyaudio
첫번째 행을 다음과 같이 실행.
두번째 행을 다음과 같이 실행.
세번째 행을 다음과 같이 실행.
네번째 행을 다음과 같이 실행.
다섯번째 행을 다음과 같이 실행.
자, 이제 모든 설치는 완료가 되었고, 실제 예제를 다음과 같이 실행을 했다. 물론 Python3 폴더 안에 있는 예제이다.
하지만, libkwscmdapi.so 파일이 없어서 Error가 발생했다. libkwscmdapi.so 파일은 하기와 같이 ai-makers-kit-master/lib에 위치해 있다.
libkwscmdapi.so 파일의 경로를 ld.so.conf 파일에 등록을 해주어야 한다.