aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/examples/android/BUILD
blob: 4d2437e7d3714e1b8b427b0c6197b295c0355b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Description:
#   TensorFlow camera demo app for Android.

load("@build_bazel_rules_android//android:rules.bzl", "android_binary")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])  # Apache 2.0

exports_files(["LICENSE"])

# Build the demo native demo lib from the original directory to reduce code
# reuse. Note that the Java counterparts (ObjectTracker.java and
# ImageUtils.java) are still duplicated.
cc_library(
    name = "tensorflow_native_libs",
    srcs = [
        "//tensorflow/examples/android:libtensorflow_demo.so",
    ],
    tags = [
        "manual",
        "notap",
    ],
)

android_binary(
    name = "tflite_demo",
    srcs = glob([
        "app/src/main/java/**/*.java",
    ]),
    # Package assets from assets dir as well as all model targets.
    # Remove undesired models (and corresponding Activities in source)
    # to reduce APK size.
    assets = [
        "//tensorflow/contrib/lite/examples/android/app/src/main/assets:labels_mobilenet_quant_v1_224.txt",
        "@tflite_mobilenet//:mobilenet_quant_v1_224.tflite",
        "@tflite_conv_actions_frozen//:conv_actions_frozen.tflite",
        "//tensorflow/contrib/lite/examples/android/app/src/main/assets:conv_actions_labels.txt",
        "@tflite_mobilenet_ssd//:mobilenet_ssd.tflite",
        "@tflite_mobilenet_ssd_quant//:detect.tflite",
        "//tensorflow/contrib/lite/examples/android/app/src/main/assets:box_priors.txt",
        "//tensorflow/contrib/lite/examples/android/app/src/main/assets:coco_labels_list.txt",
    ],
    assets_dir = "",
    custom_package = "org.tensorflow.lite.demo",
    inline_constants = 1,
    manifest = "app/src/main/AndroidManifest.xml",
    nocompress_extensions = [
        ".tflite",
    ],
    resource_files = glob(["app/src/main/res/**"]),
    tags = [
        "manual",
        "notap",
    ],
    deps = [
        ":tensorflow_native_libs",
        "//tensorflow/contrib/lite/java:tensorflowlite",
    ],
)