17 #include <unordered_map>
20 #include <onnxruntime_cxx_api.h>
31 :
m_env(ORT_LOGGING_LEVEL_WARNING,
"MLClassifier"),
39 template <
typename track_container_t,
typename traj_t,
40 template <
typename>
class holder_t>
42 std::unordered_map<
int, std::vector<int>>&
clusters,
49 trackNb += val.size();
55 for (
const auto& [key, val] : clusters) {
56 for (
const auto&
trackID : val) {
57 auto track = tracks.getTrack(
trackID);
59 tracks.trackStateContainer(), track.tipIndex());
60 networkInput(inputID, 0) = trajState.
nStates;
61 networkInput(inputID, 1) = trajState.nMeasurements;
62 networkInput(inputID, 2) = trajState.nOutliers;
63 networkInput(inputID, 3) = trajState.nHoles;
64 networkInput(inputID, 4) = trajState.NDF;
65 networkInput(inputID, 5) = (trajState.chi2Sum * 1.0) /
66 (trajState.NDF != 0 ? trajState.NDF : 1);
73 std::vector<std::vector<float>> outputTensor =
84 std::unordered_map<
int, std::vector<int>>&
clusters,
85 std::vector<std::vector<float>>& outputTensor)
const {
86 std::vector<int> goodTracks;
90 for (
const auto& [key, val] :
clusters) {
92 float bestTrackScore = 0;
93 for (
const auto& track : val) {
94 if (outputTensor[iOut][0] > bestTrackScore) {
95 bestTrackScore = outputTensor[iOut][0];
100 goodTracks.push_back(bestTrackID);
110 template <
typename track_container_t,
typename traj_t,
111 template <
typename>
class holder_t>
113 std::unordered_map<
int, std::vector<int>>&
clusters,
116 std::vector<std::vector<float>> outputTensor =