In the "auto matched = manager->update" 'update' reported such an error: In template: chosen constructor is explicit in copy-initialization error occurred here in instantiation of member function 'TrackerManager::update' requested here explicit constructor declared here in implicit initialization of field 'mask_gpu' with omitted initializer in implicit initialization of field 'info' with omitted initializer. May I ask how to solve it?
include
include "DeepSORT.h"
include "Extractor.h"
include "TrackerManager.h"
using namespace std;
using namespace cv;
namespace {
float iou(const Rect2f &bb_test, const Rect2f &bb_gt) {
auto in = (bb_test & bb_gt).area();
auto un = bb_test.area() + bb_gt.area() - in;
if (un < DBL_EPSILON)
return 0;
return in / un;
}
}
torch::Tensor iou_dist(const vector &dets, const vector &trks) {
auto trk_num = trks.size();
auto det_num = dets.size();
auto dist = torch::empty({int64_t(trk_num), int64_t(det_num)});
for (size_t i = 0; i < trk_num; i++) // compute iou matrix as a distance matrix
{
for (size_t j = 0; j < det_num; j++) {
dist[i][j] = 1 - iou(trks[i], dets[j]);
}
}
return dist;
}
In the "auto matched = manager->update" 'update' reported such an error: In template: chosen constructor is explicit in copy-initialization error occurred here in instantiation of member function 'TrackerManager::update' requested here explicit constructor declared here in implicit initialization of field 'mask_gpu' with omitted initializer in implicit initialization of field 'info' with omitted initializer. May I ask how to solve it?
include
include "DeepSORT.h"
include "Extractor.h"
include "TrackerManager.h"
using namespace std; using namespace cv;
namespace { float iou(const Rect2f &bb_test, const Rect2f &bb_gt) { auto in = (bb_test & bb_gt).area(); auto un = bb_test.area() + bb_gt.area() - in;
}
torch::Tensor iou_dist(const vector &dets, const vector &trks) {
auto trk_num = trks.size();
auto det_num = dets.size();
auto dist = torch::empty({int64_t(trk_num), int64_t(det_num)});
for (size_t i = 0; i < trk_num; i++) // compute iou matrix as a distance matrix
{
for (size_t j = 0; j < det_num; j++) {
dist[i][j] = 1 - iou(trks[i], dets[j]);
}
}
return dist;
}
DeepSORT::DeepSORT(const array<int64_t, 2> &dim) : extractor(make_unique()),
manager(make_unique<TrackerManager>(data, dim)),
feat_metric(make_unique<FeatureMetric>(data)) {
}
vector DeepSORT::update(const std::vector &detections, cv::Mat ori_img)
{
manager->predict();
manager->remove_nan();
}