forked from tensorflow/tflite-micro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The corresponding change in upstream TF is: tensorflow/tensorflow#48809 Bug: http://b/184884735
- Loading branch information
1 parent
27eff3c
commit cfde2a2
Showing
3 changed files
with
190 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# Description: | ||
# TensorFlow Lite for Microcontrollers Vision Example. | ||
package( | ||
default_visibility = ["//visibility:public"], | ||
features = ["-layering_check"], | ||
licenses = ["notice"], | ||
) | ||
|
||
cc_library( | ||
name = "model_settings", | ||
srcs = [ | ||
"model_settings.cc", | ||
], | ||
hdrs = [ | ||
"model_settings.h", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "person_detect_model_data", | ||
srcs = [ | ||
"@person_detect_data//:person_detect_model_data", | ||
], | ||
hdrs = [ | ||
"person_detect_model_data.h", | ||
], | ||
tags = [ | ||
"no_oss", # TODO(b/174680668): Exclude from OSS. | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "simple_images_test_data", | ||
srcs = [ | ||
"no_person_image_data.cc", | ||
"person_image_data.cc", | ||
], | ||
hdrs = [ | ||
"no_person_image_data.h", | ||
"person_image_data.h", | ||
], | ||
tags = [ | ||
"no_oss", # TODO(b/174680668): Exclude from OSS. | ||
], | ||
deps = [ | ||
":model_settings", | ||
], | ||
) | ||
|
||
cc_test( | ||
name = "person_detection_test", | ||
srcs = ["person_detection_test.cc"], | ||
tags = [ | ||
"no_oss", # TODO(b/174680668): Exclude from OSS. | ||
], | ||
deps = [ | ||
":model_settings", | ||
":person_detect_model_data", | ||
":simple_images_test_data", | ||
"//tensorflow/lite/c:common", | ||
"//tensorflow/lite/micro:micro_error_reporter", | ||
"//tensorflow/lite/micro:micro_framework", | ||
"//tensorflow/lite/micro:op_resolvers", | ||
"//tensorflow/lite/micro/testing:micro_test", | ||
"//tensorflow/lite/schema:schema_fbs", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "image_provider", | ||
srcs = [ | ||
"image_provider.cc", | ||
], | ||
hdrs = [ | ||
"image_provider.h", | ||
], | ||
deps = [ | ||
":model_settings", | ||
"//tensorflow/lite/c:common", | ||
"//tensorflow/lite/micro:micro_error_reporter", | ||
], | ||
) | ||
|
||
cc_test( | ||
name = "image_provider_test", | ||
srcs = [ | ||
"image_provider_test.cc", | ||
], | ||
deps = [ | ||
":image_provider", | ||
":model_settings", | ||
"//tensorflow/lite/c:common", | ||
"//tensorflow/lite/micro:micro_error_reporter", | ||
"//tensorflow/lite/micro/testing:micro_test", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "detection_responder", | ||
srcs = [ | ||
"detection_responder.cc", | ||
], | ||
hdrs = [ | ||
"detection_responder.h", | ||
], | ||
deps = [ | ||
"//tensorflow/lite/c:common", | ||
"//tensorflow/lite/micro:micro_error_reporter", | ||
], | ||
) | ||
|
||
cc_test( | ||
name = "detection_responder_test", | ||
srcs = [ | ||
"detection_responder_test.cc", | ||
], | ||
deps = [ | ||
":detection_responder", | ||
"//tensorflow/lite/micro/testing:micro_test", | ||
], | ||
) | ||
|
||
cc_binary( | ||
name = "person_detection", | ||
srcs = [ | ||
"main.cc", | ||
"main_functions.cc", | ||
"main_functions.h", | ||
], | ||
tags = [ | ||
"no_oss", # TODO(b/174680668): Exclude from OSS. | ||
], | ||
deps = [ | ||
":detection_responder", | ||
":image_provider", | ||
":model_settings", | ||
":person_detect_model_data", | ||
"//tensorflow/lite/micro:micro_error_reporter", | ||
"//tensorflow/lite/micro:micro_framework", | ||
"//tensorflow/lite/micro:op_resolvers", | ||
"//tensorflow/lite/micro:system_setup", | ||
"//tensorflow/lite/schema:schema_fbs", | ||
], | ||
) |
46 changes: 46 additions & 0 deletions
46
tensorflow/lite/micro/examples/person_detection/utils/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Description: | ||
# TensorFlow Lite for Microcontrollers Vision Example Utils. | ||
package( | ||
features = ["-layering_check"], | ||
licenses = ["notice"], | ||
) | ||
|
||
py_binary( | ||
name = "raw_to_bitmap", | ||
srcs = ["raw_to_bitmap.py"], | ||
python_version = "PY3", | ||
srcs_version = "PY3ONLY", | ||
tags = [ | ||
"no_oss", # TODO(b/186670822): enable once tflite-micro supports bazel+Python | ||
], | ||
deps = ["//third_party/py/numpy"], | ||
) | ||
|
||
py_library( | ||
name = "raw_to_bitmap_lib", | ||
srcs = ["raw_to_bitmap.py"], | ||
srcs_version = "PY3", | ||
tags = [ | ||
"no_oss", # TODO(b/186670822): enable once tflite-micro supports bazel+Python | ||
], | ||
deps = [ | ||
"//third_party/py/numpy", | ||
], | ||
) | ||
|
||
py_test( | ||
name = "raw_to_bitmap_test", | ||
srcs = ["raw_to_bitmap_test.py"], | ||
data = glob(["testdata/**"]), | ||
python_version = "PY3", | ||
tags = [ | ||
"no_oss", # TODO(b/174680668): Exclude Python tests from OSS. | ||
"nomicro_static", # TF dep incompatible w/ TF_LITE_STATIC_MEMORY. | ||
"noubsan", # TODO(b/144512025): Fix raw_to_bitmap_test to fix ubsan failure. | ||
], | ||
deps = [ | ||
":raw_to_bitmap_lib", | ||
"//tensorflow/python:platform_test", | ||
"//third_party/py/numpy", | ||
], | ||
) |