File tree 8 files changed +32
-38
lines changed
src/main/java/com/talkingdata/myna/demo
java/com/talkingdata/myna
8 files changed +32
-38
lines changed Original file line number Diff line number Diff line change 3
3
buildscript {
4
4
repositories {
5
5
jcenter()
6
+ google()
6
7
}
7
8
dependencies {
8
- classpath ' com.android.tools.build:gradle:2.3.3 '
9
+ classpath ' com.android.tools.build:gradle:3.0.1 '
9
10
10
11
// NOTE: Do not place your application dependencies here; they belong
11
12
// in the individual module build.gradle files
@@ -15,6 +16,7 @@ buildscript {
15
16
allprojects {
16
17
repositories {
17
18
jcenter()
19
+ google()
18
20
}
19
21
}
20
22
Original file line number Diff line number Diff line change 1
1
apply plugin : ' com.android.application'
2
2
3
3
android {
4
- signingConfigs {
5
- config {
6
- keyAlias ' tdsdk'
7
- keyPassword ' TDRocks!12'
8
- storeFile file(' /Users/xhrwang/work/tdsdktest.keystore' )
9
- storePassword ' TDRocks!12'
10
- }
11
- }
12
- compileSdkVersion 25
13
- buildToolsVersion " 25.0.3"
4
+ compileSdkVersion 27
5
+ buildToolsVersion ' 27.0.3'
14
6
15
7
defaultConfig {
16
8
applicationId " com.talkingdata.myna.demo"
@@ -24,19 +16,17 @@ android {
24
16
buildTypes {
25
17
release {
26
18
minifyEnabled true
27
- signingConfig signingConfigs. config
28
19
proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
29
20
}
30
21
debug {
31
- signingConfig signingConfigs. config
32
22
}
33
23
}
34
24
}
35
25
36
26
dependencies {
37
27
// compile fileTree(dir: 'libs', include: ['*.jar'])
38
- compile ' com.android.support:appcompat-v7:25.3.1 '
28
+ compile ' com.android.support:appcompat-v7:27.1.0 '
39
29
compile project(' :lib-Myna' )
40
- compile ' com.android.support:multidex:1.0.1 '
41
- compile ' com.google.android.gms:play-services-awareness:11.0 .0'
30
+ compile ' com.android.support:multidex:1.0.3 '
31
+ compile ' com.google.android.gms:play-services-awareness:11.8 .0'
42
32
}
Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ private void xgBoost(){
102
102
}
103
103
104
104
private void handHolding (){
105
- HandHoldingClassifier xgBoostClassifier = new HandHoldingClassifier ();
106
- HandHoldingRecognizer handHoldingRecognizer = new HandHoldingRecognizer (xgBoostClassifier , new MyCallback ());
105
+ HandHoldingClassifier classifier = new HandHoldingClassifier ();
106
+ HandHoldingRecognizer handHoldingRecognizer = new HandHoldingRecognizer (classifier , new MyCallback ());
107
107
handHoldingRecognizer .setSamplingInterval (20 );
108
108
handHoldingRecognizer .addSensorType (Sensor .TYPE_GAME_ROTATION_VECTOR );
109
109
DataScientistAPI .addRecognizer (handHoldingRecognizer );
Original file line number Diff line number Diff line change 1
- # Project-wide Gradle settings.
2
-
3
- # IDE (e.g. Android Studio) users:
4
- # Gradle settings configured through the IDE *will override*
5
- # any settings specified in this file.
6
-
1
+ # # Project-wide Gradle settings.
2
+ #
7
3
# For more details on how to configure your build environment visit
8
4
# http://www.gradle.org/docs/current/userguide/build_environment.html
9
-
5
+ #
10
6
# Specifies the JVM arguments used for the daemon process.
11
7
# The setting is particularly useful for tweaking memory settings.
12
- org.gradle.jvmargs =-Xmx1536m
13
-
8
+ # Default value: -Xmx1024m -XX:MaxPermSize=256m
9
+ # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10
+ #
14
11
# When configured, Gradle will run in incubating parallel mode.
15
12
# This option should only be used with decoupled projects. More details, visit
16
13
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17
14
# org.gradle.parallel=true
15
+ # Mon Dec 11 17:40:25 CST 2017
16
+ systemProp.http.proxyHost =127.0.0.1
17
+ org.gradle.jvmargs =-Xmx1536m
18
+ systemProp.http.proxyPort =8090
Original file line number Diff line number Diff line change 1
1
apply plugin : ' com.android.library'
2
2
3
3
android {
4
- compileSdkVersion 25
5
- buildToolsVersion ' 25 .0.3'
4
+ compileSdkVersion 27
5
+ buildToolsVersion ' 27 .0.3'
6
6
7
7
defaultConfig {
8
8
minSdkVersion 14
@@ -19,6 +19,6 @@ android {
19
19
}
20
20
21
21
dependencies {
22
- compile ' org.tensorflow:tensorflow-android:1.2 .0'
23
- provided ' com.google.android.gms:play-services-awareness:11.0.2 '
22
+ compile ' org.tensorflow:tensorflow-android:1.6 .0'
23
+ provided ' com.google.android.gms:play-services-awareness:11.8.0 '
24
24
}
Original file line number Diff line number Diff line change @@ -189,8 +189,8 @@ public void run() {
189
189
}
190
190
recognizer .dataSet [recognizer .getSamplingPointCount () / 2 + recognizer .dataSetIndex ] = new SensorData ();
191
191
recognizer .dataSet [recognizer .getSamplingPointCount () / 2 + recognizer .dataSetIndex ].clone (latestSampledData );
192
- recognizer .dataSet [recognizer .dataSetIndex ].timestamp = System .currentTimeMillis ();
193
- Utils .calculateWorldAcce (recognizer .dataSet [recognizer .dataSetIndex ]);
192
+ recognizer .dataSet [recognizer .getSamplingPointCount () / 2 + recognizer . dataSetIndex ].timestamp = System .currentTimeMillis ();
193
+ Utils .calculateWorldAcce (recognizer .dataSet [recognizer .getSamplingPointCount () / 2 + recognizer . dataSetIndex ]);
194
194
if (recognizer .dataSetIndex == recognizer .getSamplingPointCount () / 2 - 1 ) {
195
195
try {
196
196
recognizer .recognitionHandler .post (new Runnable () {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Android 平台情景感知框架
6
6
7
7
8
8
![ ] ( images/myna.png )
9
-
9
+
10
10
11
11
Myna 项目中包含一个测试 Demo 工程:demo-myna, 将该工程和 Myna 项目本身导入到 Android Studio 中,就可以开始调试了。
12
12
@@ -17,16 +17,17 @@ Myna 提供了两套接口:
17
17
18
18
## 更新 2017-07-12
19
19
20
- - 支持下面五种行为类型 :
20
+ - 支持下面 6 种行为类型 :
21
21
1. Walking
22
22
2. Running
23
23
3. Bus
24
24
4. Subway
25
25
5. Car
26
26
6. Stationary
27
27
- 新增 XGBoost 和基于 Tensorflow 的 LSTM 分类模型。
28
- 1. `Dataset` 目录下有数据集下载链接、数据处理脚本和 XGBoost 模型训练脚本。
29
- 2. 使用 LSTM 模型需要时需要提供训练好的模型和 Tensorflow 的动态库以及 Java Interface 包。Tensorflow 官方已经提供了通过 `AAR` 格式依赖 Tensorflow 动态库和 interface 的方法,Myna 已经更新使用该方式。具体请参考:[Android TensorFlow support](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/android/README.md)。LSTM 预训练模型位于测试工程的 `assets` 目录下。由于训练数据量不够,该模型的准确率较低,仅可用于 End2End 方案验证,请勿用于生产环境。
28
+ 1 . ` Dataset ` 目录下有数据集下载链接、数据处理脚本和 XGBoost 模型训练脚本。
29
+ 2 . 使用 LSTM 模型需要时需要提供训练好的模型和 Tensorflow 的动态库以及 Java Interface 包。Tensorflow 官方已经提供了通过 ` AAR ` 格式依赖 Tensorflow 动态库和 interface 的方法,Myna 已经更新使用该方式。具体请参考:[ Android TensorFlow support] ( https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/android/README.md ) 。LSTM 预训练模型位于测试工程的 ` assets ` 目录下。由于训练数据量不够,该模型的准确率较低,仅可用于 End2End 方案验证,请勿用于生产环境。
30
+ - 增加手持状态检测。
30
31
31
32
Myna 使用随机森林分类算法的一种开源实现--** Dice** 进行的实时用户行为识别:
32
33
72
73
开源协议: [ Apache 2.0] ( https://www.apache.org/licenses/LICENSE-2.0 )
73
74
74
75
Copyright 2016 TalkingData
75
-
76
+
76
77
Licensed under the Apache License, Version 2.0 (the "License");
77
78
you may not use this file except in compliance with the License.
78
79
You may obtain a copy of the License at
You can’t perform that action at this time.
0 commit comments