2 // Copyright (c) 2018 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
27 #include "Processor.hpp"
29 #include "VOCAnnotationParser.hpp"
33 class ObjectDetectionProcessor : public Processor {
35 struct ObjectDetectionInferenceMetrics : public InferenceMetrics {
37 AveragePrecisionCalculator apc;
39 explicit ObjectDetectionInferenceMetrics(double threshold) : apc(threshold) { }
43 std::string annotationsPath;
45 std::map<std::string, int> classes;
48 bool scaleProposalToInputSize;
50 virtual std::map<std::string, std::list<DetectedObject>> processResult(std::vector<std::string> files) = 0;
53 ObjectDetectionProcessor(const std::string& flags_m, const std::string& flags_d, const std::string& flags_i, const std::string& subdir, int flags_b,
55 InferenceEngine::InferencePlugin plugin, CsvDumper& dumper,
56 const std::string& flags_a, const std::string& classes_list_file, PreprocessingOptions preprocessingOptions, bool scaleSizeToInputSize);
58 shared_ptr<InferenceMetrics> Process();
59 virtual void Report(const InferenceMetrics& im);
60 virtual ~ObjectDetectionProcessor() {}