AlexeyAB
2017-08-04 57fa745be879e9fcbe007651bd190d3a40de3f38
src/yolo_v2_class.cpp
@@ -102,6 +102,15 @@
#endif
}
YOLODLL_API int Detector::get_net_width() {
   detector_gpu_t &detector_gpu = *reinterpret_cast<detector_gpu_t *>(detector_gpu_ptr.get());
   return detector_gpu.net.w;
}
YOLODLL_API int Detector::get_net_height() {
   detector_gpu_t &detector_gpu = *reinterpret_cast<detector_gpu_t *>(detector_gpu_ptr.get());
   return detector_gpu.net.h;
}
YOLODLL_API std::vector<bbox_t> Detector::detect(std::string image_filename, float thresh)
{
@@ -174,7 +183,15 @@
   im.h = img.h;
   im.w = img.w;
   image sized = resize_image(im, net.w, net.h);
   image sized;
   if (net.w == im.w && net.h == im.h) {
      sized = make_image(im.w, im.h, im.c);
      memcpy(sized.data, im.data, im.w*im.h*im.c * sizeof(float));
   }
   else
      sized = resize_image(im, net.w, net.h);
   layer l = net.layers[net.n - 1];
   float *X = sized.data;