forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 8
/
BUILD
81 lines (75 loc) · 2.18 KB
/
BUILD
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Description:
# TensorFlow Lite Example Label Image.
load("//tensorflow/lite:build_def.bzl", "tflite_linkopts")
package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)
exports_files(glob([
"testdata/*.bmp",
]))
cc_binary(
name = "label_image",
srcs = [
"get_top_n.h",
"get_top_n_impl.h",
"label_image.cc",
],
linkopts = tflite_linkopts() + select({
"//tensorflow:android": [
"-pie", # Android 5.0 and later supports only PIE
"-lm", # some builtin ops, e.g., tanh, need -lm
],
"//conditions:default": [],
}),
deps = [
":bitmap_helpers",
"//tensorflow/lite:framework",
"//tensorflow/lite:string_util",
"//tensorflow/lite/delegates/nnapi:nnapi_delegate",
"//tensorflow/lite/kernels:builtin_ops",
"//tensorflow/lite/profiling:profiler",
"//tensorflow/lite/tools/evaluation:utils",
"@com_google_absl//absl/memory",
] + select({
"//tensorflow:android": ["//tensorflow/lite/delegates/gpu:gl_delegate"],
"//tensorflow:android_arm64": ["//tensorflow/lite/delegates/gpu:gl_delegate"],
"//conditions:default": [],
}),
)
cc_library(
name = "bitmap_helpers",
srcs = ["bitmap_helpers.cc"],
hdrs = [
"bitmap_helpers.h",
"bitmap_helpers_impl.h",
"label_image.h",
],
deps = [
"//tensorflow/lite:builtin_op_data",
"//tensorflow/lite:framework",
"//tensorflow/lite:string",
"//tensorflow/lite:string_util",
"//tensorflow/lite/kernels:builtin_ops",
"//tensorflow/lite/schema:schema_fbs",
] + select({
"//tensorflow:android": ["//tensorflow/lite/delegates/gpu:gl_delegate"],
"//tensorflow:android_arm64": ["//tensorflow/lite/delegates/gpu:gl_delegate"],
"//conditions:default": [],
}),
)
cc_test(
name = "label_image_test",
srcs = [
"get_top_n.h",
"get_top_n_impl.h",
"label_image_test.cc",
],
data = [
"testdata/grace_hopper.bmp",
],
deps = [
":bitmap_helpers",
"@com_google_googletest//:gtest",
],
)