2017年12月1日に開催されたVuzix Developer Conferenceでの発表資料です。
「M300で アプリ開発」
C-LIS CO., LTD.
View Slide
C-LIS CO., LTD.༗ࢁܓೋʢ,FJKJ"3*:"."ʣ$-*4$0 -5%"OESPJEΞϓϦ։ൃνϣοτσΩϧPhoto by Koji MORIGUCHI (MORIGCHOWDER)
76;*9%FWFMPQFS$POGFSFODF .ͰɹɹɹɹΞϓϦ։ൃ
.
6*ʢग़ྗʣnHD - 640x360(16:9)
6*ʢೖྗʣΧϝϥ
6*ʢೖྗʣKEYCODE_DPAD_LEFTKEYCODE_DPAD_RIGHTKEYCODE_ENTER
6*ʢೖྗʣʔϘλϯΛԡ͠ϗʔϜϘλϯKEYCODE_BACKKEYCODE_MENU
6*ʢೖྗʣλονύου
.ΞϓϦ։ൃߟྀ͖͢3VOUJNF1FSNJTTJPOΧϝϥͷ্Լλονύωϧʹґଘ͠ͳ͍ը໘ઃܭ
"OESPJE.BSTINBMMPX
3VOUJNF1FSNJTTJPO
Χϝϥͷ্Լ
CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE);CameraCharacteristics characteristics= manager.getCameraCharacteristics(cameraId);mSensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);// Orientationint rotation = activity.getWindowManager().getDefaultDisplay().getRotation();int orientation = (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;captureBuilder.set(CaptureRequest.JPEG_ORIENTATION, orientation);ݱࡏͷը໘ํɾΧϝϥͷํΛߟྀhttps://github.com/googlesamples/android-Camera2Basic
λονύωϧʹґଘ͠ͳ͍ը໘ઃܭ
ࣄྫ̍ϑΥʔΧεͷҠಈ
ϑΥʔΧεͷॱ൪͕ײతͰͳ͍
android:id="@+id/button1"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 1"/>android:id="@+id/button2"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 2"/>ϑΥʔΧεҠಈandroid:id="@+id/button3"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 3"/>android:id="@+id/button4"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 4"/>
android:id="@+id/button1"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 1"android:nextFocusRight="@+id/button4"android:nextFocusLeft="@+id/button2"/>android:id="@+id/button2"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 2"android:nextFocusRight="@+id/button1"android:nextFocusLeft="@+id/button3"/>OFYU'PDVT-FGU3JHIUandroid:id="@+id/button3"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 3"android:nextFocusRight="@+id/button2"android:nextFocusLeft="@+id/button4"/>android:id="@+id/button4"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="Button 4"android:nextFocusRight="@+id/button3"android:nextFocusLeft="@+id/button1"/>
ϑΥʔΧεҠಈઃఆޙ
ࣄྫ̎λον͕͑ͳ͍߹ͷ6*
ΞΫγϣϯόʔͷεΠονʹΞΫηεͰ͖ͳ͍https://github.com/DeviceConnect/DeviceConnect-Android
xmlns:app="http://schemas.android.com/apk/res-auto">android:id="@+id/activity_service_manager_power"app:actionViewClass="android.widget.Switch"app:showAsAction="always"android:title="@string/app_name"/>android:id="@+id/activity_service_menu_item_settings"app:showAsAction="never"android:title="@string/activity_service_menu_settings"/>android:id="@+id/activity_service_menu_item_help"app:showAsAction="never"android:title="@string/activity_service_menu_help"/>SFTNFOVBDUJWJUZ@TFSWJDF@MJTUYNM
xmlns:app="http://schemas.android.com/apk/res-auto">android:id="@+id/activity_service_menu_item_settings"app:showAsAction="never"android:title="@string/activity_service_menu_settings" />android:id="@+id/activity_service_menu_item_help"app:showAsAction="never"android:title="@string/activity_service_menu_help" />SFTNFOVOPUPVDIBDUJWJUZ@TFSWJDF@MJTUYNM
android:id="@+id/activity_service_list_buttons_container"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignParentBottom="true">android:id="@+id/activity_service_list_manager_switch"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_margin="8dp"android:layout_weight="1"android:text="@string/app_name" />android:id="@+id/activity_service_list_search_button"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_margin="8dp"android:layout_weight="1"android:text="@string/activity_service_list_search" />SFTMBZPVUOPUPVDIBDUJWJUZ@TFSWJDF@MJTUYNM
λονύωϧ͕͑ͳ͍6*ʹରԠ
76;*9%FWFMPQFS$POGFSFODF .ͰػցֶशΞϓϦ։ൃ
5FOTPS'MPXͱ݄ɺถ(PPHMF͕ࣾΦʔϓϯιʔεԽͨ͠ػցೳ͚ͷܭࢉϑϨʔϜϫʔΫ
5FOTPS'MPXͷಛࣄલʹܭࢉάϥϑΛߏஙɺ࣮ߦ͢ΔύϥμΠϜେنͳฒྻɾࢄܭࢉʹରԠ1$ʢαʔόʔʣʹՃ͑ͯɺ ϞόΠϧɺϘʔυίϯϐϡʔλʔͳͲ ෳͷϓϥοτϑΥʔϜ্Ͱಈ࡞ʢ˞ʣ※ ݱࡏinferenceʢਪʣݶఆ
"OESPJEʹରԠͷηϯαʔใΛͬͯδΣενϟʔΛผ͢Δ"OESPJEΞϓϦͷ࡞5FOTPS'MPXͷֶशࡁΈϞσϧΛ"OESPJE ΞϓϦ͔ΒಡΈࠐΜͰར༻͢Δ
࡞Δͷ.Λணͯ͠टΛৼΔδΣενϟͰɺ:&4ɾ/0Λఆ͢Δ
Ϟσϧconv1x5 64max_pool1x3fully connected192ʢdropout 0.5ʣoutput 2size = 256
ֶश݅܇࿅σʔλ:FT /PֶशΞϧΰϦζϜ"EBNֶशόοναΠζֶशεςοϓ
ग़ྗϞσϧͷߏmodel.pbinput_accelinput_gyrosoftmax_logits
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'org.tensorflow:tensorflow-android:1.4.0' } CVJMEHSBEMF
ֶशࡁΈϞσϧͷஔ
private static final String MODEL_FILEPATH = "model.pb"; private final TensorFlowInferenceInterface mTfInference; GestureDetector(AssetManager am) { mTfInference = new TensorFlowInferenceInterface(am, MODEL_FILEPATH); } ϞσϧͷಡΈࠐΈ
GestureType recognizeGesture(float[] accelData, float[] gyroData) { mTfInference.feed("input_accel", accelData, accelData.length); mTfInference.feed("input_gyro", gyroData, gyroData.length); mTfInference.run(new String[]{"softmax_logits"}); mTfInference.fetch("softmax_logits", mRecognizeGestureResult); for (int index = 0; index < mRecognizeGestureResult.length; index++) { (FTUVSF%FUFDUPSͷ࣮ʢGFFEʣ
GestureType recognizeGesture(float[] accelData, float[] gyroData) { mTfInference.feed("input_accel", accelData, accelData.length); mTfInference.feed("input_gyro", gyroData, gyroData.length); mTfInference.run(new String[]{"softmax_logits"}); mTfInference.fetch("softmax_logits", mRecognizeGestureResult); for (int index = 0; index < mRecognizeGestureResult.length; index++) { (FTUVSF%FUFDUPSͷ࣮ʢSVOʣ
GestureType recognizeGesture(float[] accelData, float[] gyroData) { mTfInference.feed("input_accel", accelData, accelData.length); mTfInference.feed("input_gyro", gyroData, gyroData.length); mTfInference.run(new String[]{"softmax_logits"}); mTfInference.fetch("softmax_logits", mRecognizeGestureResult); for (int index = 0; index < mRecognizeGestureResult.length; index++) { (FTUVSF%FUFDUPSͷ࣮ʢGFUDIʣ
σϞ
C-LIS CO., LTD.ຊࢿྉɺ༗ݶձࣾγʔϦεͷஶ࡞Ͱ͢ɻຊࢿྉͷશ෦ɺ·ͨҰ෦ʹ͍ͭͯɺஶ࡞ऀ͔ΒจॻʹΑΔڐΛಘͣʹෳ͢Δ͜ͱې͡ΒΕ͍ͯ·͢ɻ5IF"OESPJE4UVEJPJDPOJTSFQSPEVDFEPSNPEJpFEGSPNXPSLDSFBUFEBOETIBSFECZ(PPHMFBOEVTFEBDDPSEJOHUPUFSNTEFTDSJCFEJOUIF$SFBUJWF$PNNPOT"UUSJCVUJPO-JDFOTF໊֤ɾϒϥϯυ໊ɺձ໊ࣾͳͲɺҰൠʹ֤ࣾͷඪ·ͨొඪͰ͢ɻຊࢿྉதͰɺɺɺäΛׂѪ͍ͯ͠·͢ɻ5IF"OESPJESPCPUJTSFQSPEVDFEPSNPEJpFEGSPNXPSLDSFBUFEBOETIBSFECZ(PPHMFBOEVTFEBDDPSEJOHUPUFSNTEFTDSJCFEJOUIF$SFBUJWF$PNNPOT"UUSJCVUJPO-JDFOTF