Fix AMD by changing from GetTensorData<T>() to GetTensorMutableData<T>()

This commit is contained in:
2026-04-28 13:25:02 +10:00
parent f4b74c837e
commit dcf974c35c
18 changed files with 359 additions and 48 deletions

View File

@@ -41,8 +41,10 @@ namespace ANSCENTER {
void warmupModel();
bool Init(const std::string& modelPath, bool useGPU=true, int deviceId = 0);
cv::Mat preprocess(const cv::Mat& image, float*& blob, std::vector<int64_t>& inputTensorShape);
// outputTensors is non-const because GetTensorMutableData() requires
// a non-const Ort::Value receiver — see ANSONNXCL.h for full note.
std::vector<Object> postprocess(const cv::Size& originalImageSize, const cv::Size& resizedImageShape,
const std::vector<Ort::Value>& outputTensors, const std::string& camera_id);
std::vector<Ort::Value>& outputTensors, const std::string& camera_id);
std::vector<Object> detect(const cv::Mat& image, const std::string& camera_id);
private:
static std::atomic<int> instanceCounter_; // Thread-safe counter