2021年7月21日 星期三

tm_yolov3

darknet訓練完的weight,用convert轉成tmlife後
要修改下程式才能正確辨識
tm_yolov3.cpp
static void generate_proposals(int stride, const float* feat, float prob_threshold, std::vector<Object>& objects)
  {
      static float anchors[18] = {10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326};

      int anchor_num = 3;
      int feat_w = 416.0 / stride;
      int feat_h = 416.0 / stride;
      int cls_num = 2;
      int anchor_group = 0;
      if(stride == 8)
          anchor_group = 1;
      if(stride == 16)
          anchor_group = 2;
      if(stride == 32)
          anchor_group = 3;
          ...
          ...


tm_yolov3.cpp
static void draw_objects(const cv::Mat& bgr, const std::vector<Object>& objects)
  {
      static const char* class_names[] = {
  	      "Good", "Bad"
      };

      cv::Mat image = bgr.clone();
      ...
      ...

沒有留言:

張貼留言