Skip to content

Commit 4e73909

Browse files
committed
change readme; add OPENCV_ANDROID_SDK var in CMakeLists
1 parent 7c1ba3d commit 4e73909

40 files changed

+168
-208
lines changed

FaceTracker/app/CMakeLists.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ cmake_minimum_required(VERSION 3.4.1)
66
set(CMAKE_VERBOSE_MAKEFILE on)
77
set (CMAKE_CXX_STANDARD 11)
88

9+
set(OPENCV_ANDROID_SDK /home/irina/caffe-android-lib/android_lib/opencv/sdk/native)
910

10-
# OpenCV stuff
11-
#include_directories(/home/irina/caffe-android-lib/android_lib/opencv/sdk/native/jni/include)
12-
#set(OpenCV_DIR "/home/irina/caffe-android-lib/android_lib/opencv/sdk/native/jni")
13-
#find_package(OpenCV REQUIRED)
14-
#include_directories(${OpenCV_INCLUDE_DIRS})
15-
16-
include_directories(/home/irina/caffe-android-lib/android_lib/opencv/sdk/native/jni/include)
11+
include_directories(${OPENCV_ANDROID_SDK}/jni/include)
1712
add_library( lib_opencv SHARED IMPORTED )
18-
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION /home/irina/caffe-android-lib/android_lib/opencv/sdk/native/libs/${ANDROID_ABI}/libopencv_java3.so)
13+
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${OPENCV_ANDROID_SDK}/libs/${ANDROID_ABI}/libopencv_java3.so)
1914

2015
find_library( # Sets the name of the path variable.
2116
log-lib
@@ -91,4 +86,4 @@ target_link_libraries(
9186

9287
${log-lib} )
9388

94-
add_subdirectory("./jni")
89+
add_subdirectory("./jni")

FaceTracker/app/build.gradle

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
apply plugin: 'com.android.application'
22

3-
project.ext.ASSET_DIR = projectDir.toString() + '/assets'
4-
def bazelLocation = '/usr/local/bin/bazel'
5-
def tensorflow_root = '/home/irina/tensorflow'
63
def cpuType = 'arm64-v8a'
74

85
// Output directory in the local directory for packaging into the APK.
9-
def nativeOutDir = 'libs/' + cpuType
106

11-
// Default to building with Bazel and override with make if requested.
12-
def nativeBuildRule = 'buildNativeBazel'
13-
def inferenceLibPath = tensorflow_root + '/bazel-bin/tensorflow/contrib/android/libtensorflow_inference.so'
147
android {
158
signingConfigs {
169
config {
@@ -82,38 +75,6 @@ android {
8275
}
8376
}
8477

85-
task buildNativeBazel(type: Exec) {
86-
workingDir tensorflow_root
87-
commandLine bazelLocation, 'build', '-c', 'opt', \
88-
'tensorflow/examples/android:tensorflow_native_libs', \
89-
'--crosstool_top=//external:android/crosstool', \
90-
'--cpu=' + cpuType, \
91-
'--host_crosstool_top=@bazel_tools//tools/cpp:toolchain'
92-
}
93-
94-
task buildNativeMake(type: Exec) {
95-
environment "NDK_ROOT", android.ndkDirectory
96-
// Tip: install ccache and uncomment the following to speed up
97-
// builds significantly.
98-
// environment "CC_PREFIX", 'ccache'
99-
workingDir tensorflow_root
100-
commandLine 'tensorflow/contrib/makefile/build_all_android.sh', \
101-
'-s', \
102-
'tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in', \
103-
'-t', \
104-
'libtensorflow_inference.so libtensorflow_demo.so' \
105-
//, '-T' // Uncomment to skip protobuf and speed up subsequent builds.
106-
}
107-
108-
task copyNativeLibs(type: Copy) {
109-
from inferenceLibPath
110-
into nativeOutDir
111-
duplicatesStrategy = 'include'
112-
dependsOn nativeBuildRule
113-
fileMode 0644
114-
}
115-
116-
11778
dependencies {
11879
implementation fileTree(include: ['*.jar'], dir: 'libs')
11980
androidTestImplementation 'junit:junit:4.12'

FaceTracker/app/jni/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
#add_subdirectory("./jni")
1716
project(TENSORFLOW_DETECTOR)
1817
cmake_minimum_required(VERSION 3.4.1)
1918

FaceTracker/app/jni/imageutils_jni.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ limitations under the License.
2020
#include <stdio.h>
2121
#include <stdlib.h>
2222

23-
#include "rgb2yuv.h"
24-
#include "yuv2rgb.h"
23+
#include "tensorflow/examples/android/jni/rgb2yuv.h"
24+
#include "tensorflow/examples/android/jni/yuv2rgb.h"
2525

2626
#define IMAGEUTILS_METHOD(METHOD_NAME) \
2727
Java_tensorflow_detector_spc_env_ImageUtils_##METHOD_NAME // NOLINT

FaceTracker/app/jni/object_tracking/config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#ifndef THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_CONFIG_H_
17-
#define THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_CONFIG_H_
16+
#ifndef TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_CONFIG_H_
17+
#define TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_CONFIG_H_
1818

1919
#include <math.h>
2020

@@ -297,4 +297,4 @@ struct TrackerConfig {
297297

298298
} // namespace tf_tracking
299299

300-
#endif // THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_CONFIG_H_
300+
#endif // TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_CONFIG_H_

FaceTracker/app/jni/object_tracking/flow_cache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#ifndef THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FLOW_CACHE_H_
17-
#define THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FLOW_CACHE_H_
16+
#ifndef TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FLOW_CACHE_H_
17+
#define TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FLOW_CACHE_H_
1818

1919
#include "tensorflow/examples/android/jni/object_tracking/geom.h"
2020
#include "tensorflow/examples/android/jni/object_tracking/utils.h"
@@ -303,4 +303,4 @@ class FlowCache {
303303

304304
} // namespace tf_tracking
305305

306-
#endif // THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FLOW_CACHE_H_
306+
#endif // TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FLOW_CACHE_H_

FaceTracker/app/jni/object_tracking/frame_pair.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ limitations under the License.
1515

1616
#include <float.h>
1717

18-
#include "config.h"
19-
#include "frame_pair.h"
18+
#include "tensorflow/examples/android/jni/object_tracking/config.h"
19+
#include "tensorflow/examples/android/jni/object_tracking/frame_pair.h"
2020

2121
namespace tf_tracking {
2222

FaceTracker/app/jni/object_tracking/frame_pair.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#ifndef THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FRAME_PAIR_H_
17-
#define THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FRAME_PAIR_H_
16+
#ifndef TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FRAME_PAIR_H_
17+
#define TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FRAME_PAIR_H_
1818

19-
#include "keypoint.h"
19+
#include "tensorflow/examples/android/jni/object_tracking/keypoint.h"
2020

2121
namespace tf_tracking {
2222

@@ -100,4 +100,4 @@ class FramePair {
100100

101101
} // namespace tf_tracking
102102

103-
#endif // THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FRAME_PAIR_H_
103+
#endif // TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_FRAME_PAIR_H_

FaceTracker/app/jni/object_tracking/geom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#ifndef THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GEOM_H_
17-
#define THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GEOM_H_
16+
#ifndef TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GEOM_H_
17+
#define TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GEOM_H_
1818

1919
#include "tensorflow/examples/android/jni/object_tracking/logging.h"
2020
#include "tensorflow/examples/android/jni/object_tracking/utils.h"
@@ -316,4 +316,4 @@ inline BoundingSquare GetCenteredSquare(const BoundingBox& original_box) {
316316

317317
} // namespace tf_tracking
318318

319-
#endif // THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GEOM_H_
319+
#endif // TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GEOM_H_

FaceTracker/app/jni/object_tracking/gl_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#ifndef THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GL_UTILS_H_
17-
#define THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GL_UTILS_H_
16+
#ifndef TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GL_UTILS_H_
17+
#define TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GL_UTILS_H_
1818

1919
#include <GLES/gl.h>
2020
#include <GLES/glext.h>
@@ -52,4 +52,4 @@ inline static void MapWorldSquareToUnitSquare(const BoundingSquare& square) {
5252

5353
} // namespace tf_tracking
5454

55-
#endif // THIRD_PARTY_TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GL_UTILS_H_
55+
#endif // TENSORFLOW_EXAMPLES_ANDROID_JNI_OBJECT_TRACKING_GL_UTILS_H_

0 commit comments

Comments
 (0)