Add continuous TensorRT camera inference and ready-to-run Orin package

This commit is contained in:
zmv
2026-09-23 11:28:29 +08:00
commit 71723ef3b4
53 changed files with 27755 additions and 0 deletions
+100
View File
@@ -0,0 +1,100 @@
#pragma once
#include <array>
#include <cstdint>
#include <string>
#include <utility>
#include <vector>
namespace fangjia {
struct Box {
float x1{};
float y1{};
float x2{};
float y2{};
float score{};
int trackId{};
};
struct Keypoint {
float x{};
float y{};
float score{};
};
struct PersonPose {
Box box;
std::array<Keypoint, 133> keypoints{};
};
enum class LimbState {
Observed,
Provisional,
Recovered,
Reassigned,
Interpolated,
PredictedShort,
ReachableMedium,
ReachableLong,
};
inline char const* limbStateName(LimbState state) {
switch (state) {
case LimbState::Observed: return "observed";
case LimbState::Provisional: return "provisional";
case LimbState::Recovered: return "recovered";
case LimbState::Reassigned: return "reassigned";
case LimbState::Interpolated: return "interpolated";
case LimbState::PredictedShort: return "predicted_short";
case LimbState::ReachableMedium: return "reachable_medium";
case LimbState::ReachableLong: return "reachable_long";
}
return "unknown";
}
struct LimbObservation {
int trackId{};
bool left{};
LimbState state{LimbState::ReachableLong};
Keypoint elbow{};
Keypoint wrist{};
std::array<Keypoint, 21> hand{};
Box personBox{};
bool handValid{};
bool alarmEligible{};
float handQuality{};
};
// Exact pre-V2 hand evidence consumed by the Python risk stage. These points
// come from raw/isolated fusion before temporal reconstruction.
struct GlobalHand {
int personId{};
int trackId{};
bool left{};
std::string source;
std::string state;
bool distanceEligible{};
bool alarmEligible{};
float score{};
float spanPx{};
std::array<Keypoint, 21> keypoints{};
std::vector<std::pair<int, bool>> aliases;
};
struct FusionMeta {
bool limbConsensus{}, handValid{}, distanceEligible{}, alarmEligible{};
double handScore{};
std::string handSource, handState;
};
struct PoseFrameResult {
std::vector<std::array<FusionMeta, 2>> metadata;
std::vector<PersonPose> selectedPeople;
std::vector<PersonPose> smoothedPeople;
std::vector<PersonPose> v2People;
std::vector<LimbObservation> limbs;
std::vector<GlobalHand> globalHands;
};
} // namespace fangjia