#include <iostream>
#include <fstream>
#include <opencv2/opencv.hpp>
#include "yolo11.h"
#include "utils.h"

std::string model_type="yolo11";
std::string task_type="obb";
std::string task_mode="image";
std::string kmodel_path="yolo11n_obb.kmodel";
std::string image_path="test_obb.jpg";
float conf_thres=0.1;
float nms_thres=0.6;
float mask_thres=0.5;
std::vector<std::string> labels={"plane","ship","storage tank","baseball diamond","tennis court","basketball court","ground track field","harbor","bridge","large vehicle","small vehicle","helicopter","roundabout","soccer ball field","swimming pool"};
int debug_mode=2;

void setup() {
  // put your setup code here, to run once:
  cv::Mat ori_img = cv::imread(image_path);
  FrameSize image_wh={ori_img.cols,ori_img.rows};
  runtime_tensor image_tensor=mat_to_tensor(ori_img);
  std::vector<YOLOBbox> yolo_results;
  Yolo11 yolo11(task_type,task_mode,kmodel_path,image_wh,labels,conf_thres,nms_thres,mask_thres,debug_mode);
  yolo11.run(image_tensor,yolo_results);
  yolo11.draw_results(ori_img,yolo_results);
  cv::imwrite("result_"+model_type+"_"+task_type+".jpg",ori_img);
}

void loop() {
  // put your main code here, to run repeatedly:

}
