xref: /aosp_15_r20/external/tensorflow/tensorflow/examples/label_image/BUILD (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1# Description:
2#   TensorFlow C++ inference example for labeling images.
3
4load("//tensorflow:tensorflow.bzl", "tf_cc_binary")
5
6package(
7    default_visibility = ["//tensorflow:internal"],
8    licenses = ["notice"],
9)
10
11exports_files(["data/grace_hopper.jpg"])
12
13tf_cc_binary(
14    name = "label_image",
15    srcs = [
16        "main.cc",
17    ],
18    linkopts = select({
19        "//tensorflow:android": [
20            "-pie",
21            "-landroid",
22            "-ljnigraphics",
23            "-llog",
24            "-lm",
25            "-z defs",
26            "-s",
27            "-Wl,--exclude-libs,ALL",
28        ],
29        "//conditions:default": ["-lm"],
30    }),
31    deps = select({
32        "//tensorflow:android": [
33            # cc:cc_ops is used to include image ops (for label_image)
34            # Jpg, gif, and png related code won't be included
35            "//tensorflow/cc:cc_ops",
36            "//tensorflow/core:portable_tensorflow_lib",
37            # cc:android_tensorflow_image_op is for including jpeg/gif/png
38            # decoder to enable real-image evaluation on Android
39            "//tensorflow/core/kernels/image:android_tensorflow_image_op",
40        ],
41        "//conditions:default": [
42            "//tensorflow/cc:cc_ops",
43            "//tensorflow/core:core_cpu",
44            "//tensorflow/core:framework",
45            "//tensorflow/core:framework_internal",
46            "//tensorflow/core:lib",
47            "//tensorflow/core:protos_all_cc",
48            "//tensorflow/core:tensorflow",
49        ],
50    }),
51)
52
53py_binary(
54    name = "label_image_py",
55    srcs = ["label_image.py"],
56    main = "label_image.py",
57    python_version = "PY3",
58    srcs_version = "PY3",
59    deps = [
60        "//tensorflow:tensorflow_py",
61    ],
62)
63