text: // Copyright 2019 The MACE-KIT Authors. All Rights Reserved.
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //     http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  #ifndef INCLUDE_MACEKIT_OBJECT_DETECTION_H_
  #define INCLUDE_MACEKIT_OBJECT_DETECTION_H_
  
  #include <map>
  #include <vector>
  #include "macekit/mat.h"
  #include "macekit/type.h"
  #include "macekit/export.h"
  #include "macekit/status.h"
  #include "macekit/context.h"
  
  namespace mace_kit {
  
  struct MACEKIT_EXPORT ObjectDetectionContext : Context {
  };
  
  struct MACEKIT_EXPORT Object {
    float xmin;
    float ymin;
    float xmax;
    float ymax;
    int label;
    float confidence;
  };
  
  struct MACEKIT_EXPORT ObjectResult {
    std::vector<Object> objects;
  };
  
  class MACEKIT_EXPORT ObjectDetection {
   public:
    static Status Create(const ObjectDetectionContext &context,
                         ObjectDetection **object_detection_ptr);
  
    ObjectDetection() = default;
    ObjectDetection(const ObjectDetection &) = delete;
    ObjectDetection &operator=(const ObjectDetection &) = delete;
  
    virtual ~ObjectDetection() = default;
  
    virtual Status Detect(
        Mat *mat, int max_object_count, ObjectResult *result) = 0;
  };
  
  }  // namespace mace_kit
  
  #endif  // INCLUDE_MACEKIT_OBJECT_DETECTION_H_
  