Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
projects:work-in-progress:android1 [2018/03/26 13:35] – [azainab TF detect project] scipio | projects:work-in-progress:android1 [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== android tensor flow projects 01 ====== | ||
- | ===== prereq ===== | ||
- | |||
- | bazel | ||
- | < | ||
- | echo "deb [arch=amd64] http:// | ||
- | curl https:// | ||
- | sudo apt-get update && sudo apt-get install bazel | ||
- | </ | ||
- | |||
- | * android sdk (in / | ||
- | * android ndk 14b from [[https:// | ||
- | |||
- | |||
- | ===== tensorflow ===== | ||
- | |||
- | clone github tensorflow and build | ||
- | < | ||
- | cd /lab | ||
- | git clone --depth 1 https:// | ||
- | cd tensorflow.git | ||
- | </ | ||
- | |||
- | update WORKSPACE file | ||
- | < | ||
- | android_sdk_repository( | ||
- | name = " | ||
- | api_level = 25, | ||
- | # Ensure that you have the build_tools_version below installed in the | ||
- | # SDK manager as it updates periodically. | ||
- | build_tools_version = " | ||
- | # Replace with path to Android SDK on your system | ||
- | path = "/ | ||
- | ) | ||
- | # | ||
- | android_ndk_repository( | ||
- | name=" | ||
- | path="/ | ||
- | # This needs to be 14 or higher to compile TensorFlow. | ||
- | # Please specify API level to >= 21 to build for 64-bit | ||
- | # archtectures or the Android NDK will automatically select biggest | ||
- | # API level that it supports without notice. | ||
- | # Note that the NDK version is not the API level. | ||
- | api_level=25) | ||
- | </ | ||
- | |||
- | build demo | ||
- | < | ||
- | bazel build -c opt // | ||
- | </ | ||
- | ===== azainab TF detect project ===== | ||
- | |||
- | [[https:// | ||
- | |||
- | < | ||
- | git clone https:// | ||
- | cd androidTFDetect | ||
- | # download assets from https:// | ||
- | cd assets | ||
- | unzip ~/ | ||
- | </ | ||
- | |||
- | import project in android studio | ||
- | |||
- | <file txt build.gradle> | ||
- | buildscript { | ||
- | repositories { | ||
- | google() // Gradle 4.0+ | ||
- | maven { url " | ||
- | jcenter() | ||
- | } | ||
- | |||
- | dependencies { | ||
- | classpath ' | ||
- | classpath ' | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | <file txt settings.gradle> | ||
- | include ': | ||
- | |||
- | findProject(": | ||
- | </ | ||
- | |||
- | <file txt jni/ | ||
- | # | ||
- | set(TF_SRC_ROOT "/ | ||
- | # | ||
- | set(SAMPLE_SRC_DIR "/ | ||
- | </ |