#include "../include/Air_Ground_CEC/atr.h"
using namespace std;
#include "stdlib.h"


ATR::ATR()
{
}

void ATR::runCommand(){
  string ws = "cd /home/cyber/Study/Codes/catkin_ws/src/Air_Ground_CEC/src/YOLOv6";
  string CMD = "python3 ../YOLOv6/tools/infer.py --weights ../YOLOv6/yolov6n.pt --source ../YOLOv6/imgdir/";
  string Pic = "test.jpg";
  string Command = ws + "&&" + CMD + Pic;
  std::cout<<Command<<endl;
  system(Command.c_str());
}

void ATR::getSolvedPic(){
  string Path = "/home/cyber/Study/Codes/catkin_ws/src/Air_Ground_CEC/src/YOLOv6/runs/inference/exp/";
  string SolvedPicPath = Path + "test.jpg";
  QImage image = QImage(SolvedPicPath.c_str());
  std::cout<<"image"<<endl;
  emit show_solvedImage(image);
}


