minor fixes
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
1)error C2131 @ Yolo3Detection.cpp(97) -> expression doesnt evaluate to a constant caused to read of variable outside its lifetime
|
||||||
@@ -2,7 +2,12 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdlib.h> /* srand, rand */
|
#include <stdlib.h> /* srand, rand */
|
||||||
|
#ifdef __linux__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#elif _WIN32
|
||||||
|
#include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -15,10 +15,12 @@
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
#include <Windows.h>
|
#define NOMINMAX
|
||||||
#endif
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ios>
|
#include <ios>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
|
||||||
#define dnnType float
|
#define dnnType float
|
||||||
@@ -55,7 +57,13 @@
|
|||||||
|
|
||||||
#define TKDNN_TSTOP TKDNN_TSTOP_C(COL_CYANB, TKDNN_VERBOSE)
|
#define TKDNN_TSTOP TKDNN_TSTOP_C(COL_CYANB, TKDNN_VERBOSE)
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
#endif
|
#define TKDNN_TSTART auto start = std::chrono::high_resolution_clock::now();
|
||||||
|
#define TKDNN_TSTOP auto stop = std::chrono::high_resolution_clock::now(); \
|
||||||
|
std::chrono::duration<double> duration = stop -start; \
|
||||||
|
auto time_ms = std::chrono::duration_cast<std::chrono::microseconds>(duration);\
|
||||||
|
double t_ns = time_ms.count();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/********************************************************
|
/********************************************************
|
||||||
* Prints the error message, and exits
|
* Prints the error message, and exits
|
||||||
|
|||||||
+5
-4
@@ -9,6 +9,7 @@
|
|||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "kernels.h"
|
#include "kernels.h"
|
||||||
|
|
||||||
|
|
||||||
namespace tk { namespace dnn {
|
namespace tk { namespace dnn {
|
||||||
|
|
||||||
Yolo::Yolo(Network *net, int classes, int num, std::string fname_weights, int n_masks, float scale_xy, double nms_thresh, nmsKind_t nsm_kind, int new_coords) :
|
Yolo::Yolo(Network *net, int classes, int num, std::string fname_weights, int n_masks, float scale_xy, double nms_thresh, nmsKind_t nsm_kind, int new_coords) :
|
||||||
@@ -209,10 +210,10 @@ float yolo_box_iou(Yolo::box a, Yolo::box b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void box_c(const Yolo::box a, const Yolo::box b, float& top, float& bot, float& left, float& right) {
|
void box_c(const Yolo::box a, const Yolo::box b, float& top, float& bot, float& left, float& right) {
|
||||||
top = std::min(a.y - a.h / 2, b.y - b.h / 2);
|
top = (std::min)(a.y - a.h / 2, b.y - b.h / 2);
|
||||||
bot = std::max(a.y + a.h / 2, b.y + b.h / 2);
|
bot = (std::max)(a.y + a.h / 2, b.y + b.h / 2);
|
||||||
left = std::min(a.x - a.w / 2, b.x - b.w / 2);
|
left = (std::min)(a.x - a.w / 2, b.x - b.w / 2);
|
||||||
right = std::max(a.x + a.w / 2, b.x + b.w / 2);
|
right = (std::max)(a.x + a.w / 2, b.x + b.w / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/Zzh-tju/DIoU-darknet
|
// https://github.com/Zzh-tju/DIoU-darknet
|
||||||
|
|||||||
Reference in New Issue
Block a user