1load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test", "tf_py_test") 2 3package( 4 default_visibility = [ 5 "//visibility:public", 6 ], 7 licenses = ["notice"], 8) 9 10py_binary( 11 name = "accuracy_utils_py", 12 srcs = ["accuracy_utils.py"], 13 main = "accuracy_utils.py", 14 python_version = "PY3", 15 srcs_version = "PY3", 16 deps = [ 17 "//tensorflow:tensorflow_py", 18 "//third_party/py/numpy", 19 "@six_archive//:six", 20 ], 21) 22 23py_binary( 24 name = "recognize_commands_py", 25 srcs = ["recognize_commands.py"], 26 main = "recognize_commands.py", 27 python_version = "PY3", 28 srcs_version = "PY3", 29 deps = [ 30 "//tensorflow:tensorflow_py", 31 "//third_party/py/numpy", 32 "@six_archive//:six", 33 ], 34) 35 36py_binary( 37 name = "test_streaming_accuracy_py", 38 srcs = ["test_streaming_accuracy.py"], 39 main = "test_streaming_accuracy.py", 40 python_version = "PY3", 41 srcs_version = "PY3", 42 deps = [ 43 ":accuracy_utils_py", 44 ":recognize_commands_py", 45 "//tensorflow:tensorflow_py", 46 "//third_party/py/numpy", 47 ], 48) 49 50py_library( 51 name = "models", 52 srcs = [ 53 "models.py", 54 ], 55 srcs_version = "PY3", 56 deps = [ 57 "//tensorflow:tensorflow_py", 58 "//third_party/py/numpy", 59 "@six_archive//:six", 60 ], 61) 62 63tf_py_test( 64 name = "models_test", 65 size = "small", 66 srcs = ["models_test.py"], 67 tags = [ 68 "no_pip", # b/131330719 69 ], 70 deps = [ 71 ":models", 72 "//tensorflow/python:client_testlib", 73 ], 74) 75 76py_library( 77 name = "input_data", 78 srcs = [ 79 "input_data.py", 80 ], 81 srcs_version = "PY3", 82 deps = [ 83 "//tensorflow:tensorflow_py", 84 "//tensorflow/lite/experimental/microfrontend:audio_microfrontend_py", 85 "//third_party/py/numpy", 86 "@six_archive//:six", 87 ], 88) 89 90tf_py_test( 91 name = "input_data_test", 92 size = "small", 93 srcs = ["input_data_test.py"], 94 tags = [ 95 "no_pip", # b/131330719 96 "v1only", # uses contrib 97 ], 98 deps = [ 99 ":input_data", 100 ":models", 101 "//tensorflow/python:client_testlib", 102 ], 103) 104 105py_binary( 106 name = "train", 107 srcs = ["train.py"], 108 python_version = "PY3", 109 srcs_version = "PY3", 110 deps = [":train_main_lib"], 111) 112 113py_library( 114 name = "train_main_lib", 115 srcs = [ 116 "train.py", 117 ], 118 srcs_version = "PY3", 119 deps = [ 120 ":input_data", 121 ":models", 122 "//tensorflow:tensorflow_py", 123 "//third_party/py/numpy", 124 "@six_archive//:six", 125 ], 126) 127 128tf_py_test( 129 name = "train_test", 130 size = "small", 131 srcs = ["train_test.py"], 132 tags = [ 133 "no_pip", # b/131330719 134 "v1only", # uses contrib 135 ], 136 deps = [ 137 ":train_main_lib", 138 "//tensorflow/python:client_testlib", 139 ], 140) 141 142py_binary( 143 name = "freeze", 144 srcs = ["freeze.py"], 145 python_version = "PY3", 146 srcs_version = "PY3", 147 deps = [":freeze_main_lib"], 148) 149 150py_library( 151 name = "freeze_main_lib", 152 srcs = ["freeze.py"], 153 srcs_version = "PY3", 154 deps = [":freeze_lib"], 155) 156 157py_library( 158 name = "freeze_lib", 159 srcs = [ 160 "freeze.py", 161 ], 162 srcs_version = "PY3", 163 tags = [ 164 "no_pip", # b/131330719 165 ], 166 deps = [ 167 ":input_data", 168 ":models", 169 "//tensorflow:tensorflow_py", 170 ], 171) 172 173tf_py_test( 174 name = "freeze_test", 175 size = "small", 176 srcs = ["freeze_test.py"], 177 tags = [ 178 "no_pip", # b/131330719 179 "v1only", # uses contrib 180 ], 181 deps = [ 182 ":freeze_main_lib", 183 "//tensorflow/python:client_testlib", 184 ], 185) 186 187py_binary( 188 name = "wav_to_features", 189 srcs = ["wav_to_features.py"], 190 python_version = "PY3", 191 srcs_version = "PY3", 192 deps = [":wav_to_features_main_lib"], 193) 194 195py_library( 196 name = "wav_to_features_main_lib", 197 srcs = ["wav_to_features.py"], 198 srcs_version = "PY3", 199 deps = [":wav_to_features_lib"], 200) 201 202py_library( 203 name = "wav_to_features_lib", 204 srcs = [ 205 "wav_to_features.py", 206 ], 207 srcs_version = "PY3", 208 deps = [ 209 ":input_data", 210 ":models", 211 "//tensorflow:tensorflow_py", 212 ], 213) 214 215tf_py_test( 216 name = "wav_to_features_test", 217 size = "small", 218 srcs = ["wav_to_features_test.py"], 219 tags = [ 220 "no_pip", # b/131330719 221 "v1only", # uses contrib 222 ], 223 deps = [ 224 ":wav_to_features_main_lib", 225 "//tensorflow/python:client_testlib", 226 ], 227) 228 229py_binary( 230 name = "generate_streaming_test_wav", 231 srcs = ["generate_streaming_test_wav.py"], 232 python_version = "PY3", 233 srcs_version = "PY3", 234 deps = [":generate_streaming_test_wav_main_lib"], 235) 236 237py_library( 238 name = "generate_streaming_test_wav_main_lib", 239 srcs = ["generate_streaming_test_wav.py"], 240 srcs_version = "PY3", 241 deps = [":generate_streaming_test_wav_lib"], 242) 243 244py_library( 245 name = "generate_streaming_test_wav_lib", 246 srcs = [ 247 "generate_streaming_test_wav.py", 248 ], 249 srcs_version = "PY3", 250 deps = [ 251 ":input_data", 252 ":models", 253 "//tensorflow:tensorflow_py", 254 "//third_party/py/numpy", 255 ], 256) 257 258tf_py_test( 259 name = "generate_streaming_test_wav_test", 260 size = "small", 261 srcs = ["generate_streaming_test_wav_test.py"], 262 tags = [ 263 "no_pip", # b/131330719 264 "v1only", # uses contrib 265 ], 266 deps = [ 267 ":generate_streaming_test_wav_main_lib", 268 "//tensorflow/python:client_testlib", 269 ], 270) 271 272tf_cc_binary( 273 name = "label_wav_cc", 274 srcs = [ 275 "label_wav.cc", 276 ], 277 deps = [ 278 "//tensorflow/core:core_cpu", 279 "//tensorflow/core:framework", 280 "//tensorflow/core:framework_internal", 281 "//tensorflow/core:lib", 282 "//tensorflow/core:protos_all_cc", 283 "//tensorflow/core:tensorflow", 284 ], 285) 286 287py_binary( 288 name = "label_wav", 289 srcs = ["label_wav.py"], 290 python_version = "PY3", 291 srcs_version = "PY3", 292 deps = [":label_wav_main_lib"], 293) 294 295py_library( 296 name = "label_wav_main_lib", 297 srcs = ["label_wav.py"], 298 srcs_version = "PY3", 299 deps = [":label_wav_lib"], 300) 301 302py_library( 303 name = "label_wav_lib", 304 srcs = [ 305 "label_wav.py", 306 ], 307 srcs_version = "PY3", 308 deps = [ 309 "//tensorflow:tensorflow_py", 310 ], 311) 312 313tf_py_test( 314 name = "label_wav_test", 315 size = "medium", 316 srcs = ["label_wav_test.py"], 317 tags = [ 318 "no_pip", # b/131330719 319 "v1only", # uses contrib 320 ], 321 deps = [ 322 ":label_wav_main_lib", 323 "//tensorflow/python:client_testlib", 324 ], 325) 326 327cc_library( 328 name = "recognize_commands", 329 srcs = [ 330 "recognize_commands.cc", 331 ], 332 hdrs = [ 333 "recognize_commands.h", 334 ], 335 deps = [ 336 "//tensorflow/core:core_cpu", 337 "//tensorflow/core:framework", 338 "//tensorflow/core:framework_internal", 339 "//tensorflow/core:lib", 340 "//tensorflow/core:protos_all_cc", 341 "//tensorflow/core:tensorflow", 342 ], 343) 344 345tf_cc_test( 346 name = "recognize_commands_test", 347 size = "medium", 348 srcs = [ 349 "recognize_commands_test.cc", 350 ], 351 deps = [ 352 ":recognize_commands", 353 "//tensorflow/core:lib", 354 "//tensorflow/core:lib_internal", 355 "//tensorflow/core:test", 356 "//tensorflow/core:test_main", 357 "//tensorflow/core:testlib", 358 ], 359) 360 361cc_library( 362 name = "accuracy_utils", 363 srcs = [ 364 "accuracy_utils.cc", 365 ], 366 hdrs = [ 367 "accuracy_utils.h", 368 ], 369 deps = [ 370 "//tensorflow/core:core_cpu", 371 "//tensorflow/core:framework", 372 "//tensorflow/core:framework_internal", 373 "//tensorflow/core:lib", 374 "//tensorflow/core:protos_all_cc", 375 "//tensorflow/core:tensorflow", 376 ], 377) 378 379tf_cc_test( 380 name = "accuracy_utils_test", 381 size = "medium", 382 srcs = [ 383 "accuracy_utils_test.cc", 384 ], 385 deps = [ 386 ":accuracy_utils", 387 "//tensorflow/core:lib", 388 "//tensorflow/core:lib_internal", 389 "//tensorflow/core:test", 390 "//tensorflow/core:test_main", 391 "//tensorflow/core:testlib", 392 ], 393) 394 395tf_cc_binary( 396 name = "test_streaming_accuracy", 397 srcs = [ 398 "test_streaming_accuracy.cc", 399 ], 400 deps = [ 401 ":accuracy_utils", 402 ":recognize_commands", 403 "//tensorflow/core:core_cpu", 404 "//tensorflow/core:framework", 405 "//tensorflow/core:framework_internal", 406 "//tensorflow/core:lib", 407 "//tensorflow/core:lib_internal", 408 "//tensorflow/core:protos_all_cc", 409 ], 410) 411 412py_library( 413 name = "test_lib", 414 srcs_version = "PY3", 415 deps = [ 416 ":freeze", 417 ":generate_streaming_test_wav", 418 ":input_data", 419 ":label_wav", 420 ":models", 421 ":train", 422 ":wav_to_features", 423 ], 424) 425