// Copyright (C) 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once

#include <string>
#include <vector>
#include <gflags/gflags.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#ifdef _WIN32
#include <os/windows/w_dirent.h>
#else
#include <dirent.h>
#endif

/// @brief Message for help argument
static const char help_message[] = "Print a usage message.";

/// @brief Message for images argument
static const char image_message[] = "Required. Path to a image file.";

/// @brief Message for model argument
static const char model_message[] = "Required. Path to an .xml file with a trained model.";

/// @brief Message for assigning cnn calculation to device
static const char target_device_message[] = "Optional. Specify a target device to infer on (CPU, GPU). " \
"The demo will look for a suitable plugin for the specified device";

/// @brief Message for performance counters
static const char performance_counter_message[] = "Optional. Enable per-layer performance report.";

/// @brief Message for clDNN custom kernels desc
static const char custom_cldnn_message[] = "Optional. Required for GPU custom kernels."\
"Absolute path to the .xml file with the kernels description.";

/// @brief Message for user library argument
static const char custom_cpu_library_message[] = "Optional. Required for CPU custom layers." \
"Absolute path to a shared library with the layers implementation.";

/// @brief Message for probability threshold argument
static const char thresh_output_message[] = "Optional. Probability threshold for detections.";

/// @brief Message for probability threshold argument
static const char iou_thresh_output_message[] = "Optional. Filtering intersection over union threshold for overlapping boxes.";

/// @brief Message raw output flag
static const char raw_output_message[] = "Optional. Output inference results raw values showing.";



/// \brief Defines flag for showing help message 
DEFINE_bool(h, false, help_message);

/// \brief Define parameter for set video file of reading from camera 
/// It is a required parameter
DEFINE_string(i, "", image_message);

/// \brief Defines parameter for setting path to a model file 
/// It is a required parameter
DEFINE_string(m, "", model_message);

 

/// \brief Enables per-layer performance report
DEFINE_bool(pc, false, performance_counter_message);

/// @brief Defines GPU custom kernels path 
/// Default is ./lib
DEFINE_string(c, "", custom_cldnn_message);

/// @brief Defines absolute path to CPU library with user layers 
/// It is a optional parameter
DEFINE_string(l, "", custom_cpu_library_message);

/// \brief Defines flag to output raw scoring results
/// It is an optional parameter
DEFINE_bool(r, false, raw_output_message);

/// \brief Defines value of confidence threshold 
/// It is an optional parameter
DEFINE_double(t, 0.5, thresh_output_message);

/// \brief Defines value of intersection over union threshold
/// It is an optional parameter
DEFINE_double(iou_t, 0.4, iou_thresh_output_message);




/**
* \brief This function shows a help message
*/
static void showUsage() { 
    cout << "\nobject_detection_demo_yolov3_async [OPTION]\n";
    cout << "Options:\n\n"; 
    cout << "    -h                        " << help_message << endl;
    cout << "    -i \"<path>\"               " << image_message << endl;
    cout << "    -m \"<path>\"               " << model_message << endl;
    cout << "      -l \"<absolute_path>\"    " << custom_cpu_library_message << endl;
    cout << "          Or";
    cout << "      -c \"<absolute_path>\"    " << custom_cldnn_message << endl;
    cout << "    -d \"<device>\"             " << target_device_message << endl; 
    cout << "    -r                        " << raw_output_message << endl;
    cout << "    -t                        " << thresh_output_message << endl;
    cout << "    -iou_t                    " << iou_thresh_output_message << endl;
}
