detection_responder.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. ==============================================================================*/
  12. // Provides an interface to take an action based on the output from the person
  13. // detection model.
  14. #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_DETECTION_RESPONDER_H_
  15. #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_DETECTION_RESPONDER_H_
  16. #include "tensorflow/lite/c/common.h"
  17. #include "tensorflow/lite/micro/micro_error_reporter.h"
  18. // Called every time the results of a person detection run are available. The
  19. // `person_score` has the numerical confidence that the captured image contains
  20. // a person, and `no_person_score` has the numerical confidence that the image
  21. // does not contain a person. Typically if person_score > no person score, the
  22. // image is considered to contain a person. This threshold may be adjusted for
  23. // particular applications.
  24. void RespondToDetection(tflite::ErrorReporter* error_reporter,
  25. int8_t person_score, int8_t no_person_score);
  26. #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_DETECTION_RESPONDER_H_