| | |
| | | #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) |
| | | { |
| | |
| | | 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; |