···2020#include "ht_model.hpp"
2121#include "templates/NaivePermutationSort.hpp"
22222323+#include <future>
2424+2325// Flags to tell state tracker that these are indeed valid joints
2426static const enum xrt_space_relation_flags valid_flags_ht = (enum xrt_space_relation_flags)(
2527 XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT |
-4
src/xrt/drivers/ht/ht_driver.cpp
···41414242#include "ht_algorithm.hpp"
4343#include "ht_model.hpp"
4444-#include "ht_models.hpp"
45444645#include <cjson/cJSON.h>
4746#include <opencv2/core/mat.hpp>
···605604606605 // Lock this mutex so we don't try to free things as they're being used on the last iteration
607606 os_mutex_lock(&htd->unlocked_between_frames);
608608- destroyOnnx(htd);
609607 // Remove the variable tracking.
610608 u_var_remove_root(htd);
611609···683681684682 htd->views[0].view = 0;
685683 htd->views[1].view = 1;
686686-687687- initOnnx(htd);
688684689685 htd->base.tracking_origin = &htd->tracking_origin;
690686 htd->base.tracking_origin->type = XRT_TRACKING_TYPE_RGB;
-30
src/xrt/drivers/ht/ht_driver.hpp
···36363737#include <opencv2/opencv.hpp>
38383939-#include "core/session/onnxruntime_c_api.h"
4040-4141-#include <future>
4239#include <vector>
43404441using namespace xrt::auxiliary::util;
···203200 bool htAlgorithm_approves = false;
204201};
205202206206-207207-struct ModelInfo
208208-{
209209- OrtSession *session = nullptr;
210210- OrtMemoryInfo *memoryInfo = nullptr;
211211- // std::vector's don't make too much sense here, but they're oh so easy
212212- std::vector<int64_t> input_shape;
213213- size_t input_size_bytes;
214214- std::vector<const char *> output_names;
215215- std::vector<const char *> input_names;
216216-};
217217-218218-219203// Forward declaration for ht_view
220204struct ht_device;
221205···234218 cv::Mat debug_out_to_this;
235219236220 std::vector<HandHistory2DBBox> bbox_histories;
237237-238238- struct ModelInfo detection_model;
239239- std::vector<Palm7KP> (*run_detection_model)(struct ht_view *htv, cv::Mat &img);
240240-241241- struct ModelInfo keypoint_model;
242242- // The cv::mat is passed by value, *not* passed by reference or by pointer;
243243- // in the tight loop that sets these off we reuse that cv::Mat; changing the data pointer as all the models are
244244- // running is... going to wreak havoc let's say that.
245245- Hand2D (*run_keypoint_model)(struct ht_view *htv, cv::Mat img);
246221};
247222248223enum ht_detection_scribble
···324299 cJSON *output_array;
325300 } gst;
326301#endif
327327-328328-329329-330330- const OrtApi *ort_api;
331331- OrtEnv *ort_env;
332302333303 struct xrt_frame *frame_for_process;
334304 cv::Mat *mat_for_process;