-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# For more information about using CMake with Android Studio, read the | ||
# documentation: https://d.android.com/studio/projects/add-native-code.html | ||
|
||
# Sets the minimum version of CMake required to build the native library. | ||
|
||
cmake_minimum_required(VERSION 3.6) | ||
|
||
|
||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
set(libs "${CMAKE_SOURCE_DIR}/src/main/jniLibs") | ||
set(facesrc "${CMAKE_SOURCE_DIR}/src/main/cpp/facecaffe") | ||
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include) | ||
|
||
add_library(libopencv_java3 SHARED IMPORTED ) | ||
set_target_properties(libopencv_java3 PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_java3.so") | ||
|
||
add_library(libOpenCL SHARED IMPORTED ) | ||
set_target_properties(libOpenCL PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libOpenCL.so") | ||
|
||
add_library(libcaffe_jni SHARED IMPORTED ) | ||
set_target_properties(libcaffe_jni PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libcaffe_jni.so") | ||
|
||
add_library(libcaffe SHARED IMPORTED ) | ||
set_target_properties(libcaffe PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libcaffe.so") | ||
|
||
add_library(libarm_compute_core-static STATIC IMPORTED ) | ||
set_target_properties(libarm_compute_core-static PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libarm_compute_core-static.a") | ||
|
||
add_library(libarm_compute-static STATIC IMPORTED ) | ||
set_target_properties(libarm_compute-static PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libarm_compute-static.a") | ||
|
||
add_library(libboost_system STATIC IMPORTED ) | ||
set_target_properties(libboost_system PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libboost_system.a") | ||
|
||
add_library(libglog STATIC IMPORTED ) | ||
set_target_properties(libglog PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libglog.a") | ||
|
||
add_library(libprotobuf STATIC IMPORTED ) | ||
set_target_properties(libprotobuf PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libprotobuf.a") | ||
|
||
add_library(libproto STATIC IMPORTED ) | ||
set_target_properties(libproto PROPERTIES | ||
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libproto.a") | ||
|
||
set(LOCAL_LDLIBS "-ltinyalsa") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCPU_ONLY=1 -std=gnu++11 -fexceptions -frtti") | ||
|
||
aux_source_directory(${CMAKE_SOURCE_DIR}/src/main/cpp/ DIR_LIB_SRCS) | ||
|
||
add_library(native-lib SHARED ${DIR_LIB_SRCS}) | ||
|
||
|
||
|
||
#target_include_directories(native-lib PRIVATE ${DIR_LIB_SRCS}) | ||
|
||
find_library( # Sets the name of the path variable. | ||
log-lib | ||
|
||
# Specifies the name of the NDK library that | ||
# you want CMake to locate. | ||
log) | ||
|
||
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/src/main/cpp/facecaffe) | ||
|
||
target_link_libraries(native-lib android log tinyalsa | ||
libopencv_java3 facecaffe libcaffe | ||
libprotobuf libproto libglog libarm_compute-static | ||
libarm_compute_core-static libboost_system libcaffe_jni | ||
${log-lib} | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 24 | ||
buildToolsVersion "24.0.3" | ||
defaultConfig { | ||
applicationId "com.openailab.track" | ||
minSdkVersion 23 | ||
targetSdkVersion 24 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
externalNativeBuild { | ||
cmake { | ||
|
||
cppFlags "-std=c++11","-frtti", "-fexceptions" | ||
} | ||
} | ||
ndk{ | ||
abiFilters 'arm64-v8a' | ||
} | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
//sourceSets { | ||
// main { | ||
// jni.srcDirs = [] // disable automatic ndk-build call, which ignore our Android.mk | ||
// jniLibs.srcDir 'src/main/jni/libs' | ||
// } | ||
// } | ||
externalNativeBuild { | ||
cmake { | ||
path "CMakeLists.txt" | ||
} | ||
} | ||
|
||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'],dir: 'libs') | ||
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:24.1.1' | ||
testCompile 'junit:junit:4.12' | ||
compile project(':openCVLibrary331') | ||
compile 'com.google.android.gms:play-services-appindexing:8.4.0' | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\Users\user\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.openailab.track; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumentation test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() throws Exception { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.openailab.track", appContext.getPackageName()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.openailab.track" > | ||
|
||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> | ||
<uses-permission android:name="android.permission.CAMERA"/> | ||
<uses-permission android:name="android.permission.RECORD_AUDIO"/> | ||
<uses-feature android:name="android.hardware.camera" android:required="true"/> | ||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme" > | ||
|
||
<activity android:name=".MainActivity" > | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity><!-- ATTENTION: This was auto-generated to add Google Play services to your project for | ||
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. --> | ||
<meta-data | ||
android:name="com.google.android.gms.version" | ||
android:value="@integer/google_play_services_version" /> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
find_library( libopencv_java3 log) | ||
aux_source_directory(${CMAKE_SOURCE_DIR}/src/main/cpp/facecaffe DIR_LIB_SRCS) | ||
|
||
add_library (facecaffe STATIC ${DIR_LIB_SRCS}) |