Prevent OOM

This commit is contained in:
2026-06-18 05:55:31 +10:00
parent ebba70b9d9
commit b3436a61ee
44 changed files with 1797 additions and 66 deletions
+17
View File
@@ -761,6 +761,16 @@ namespace ANSCENTER
float CosineSimilarity(const std::vector<float>& a, const std::vector<float>& b, bool normalized);
};
class ANSENGINE_API ANSODBase {
public:
// Explicit non-copy/non-move: _modelLoading (std::atomic) deletes the
// implicit copy ops; spelling them out here gives ClangCL a clean
// anchor and documents that subclasses are never copied/moved (they
// are heap-allocated and passed by shared_ptr<...>).
ANSODBase(const ANSODBase&) = delete;
ANSODBase& operator=(const ANSODBase&) = delete;
ANSODBase(ANSODBase&&) = delete;
ANSODBase& operator=(ANSODBase&&) = delete;
ANSODBase() = default;
protected:
bool _licenseValid{ false };
bool _isInitialized{ false };
@@ -1085,6 +1095,13 @@ namespace ANSCENTER
std::vector<Object> RunInferenceInTrackingMode(const cv::Mat& input, const std::string& camera_id, std::vector<int> trackingObjectIds);// Get detected objects
};
class ANSENGINE_API ANSFDBase {
public:
// Explicit non-copy/non-move (see ANSODBase for rationale).
ANSFDBase(const ANSFDBase&) = delete;
ANSFDBase& operator=(const ANSFDBase&) = delete;
ANSFDBase(ANSFDBase&&) = delete;
ANSFDBase& operator=(ANSFDBase&&) = delete;
ANSFDBase() = default;
protected:
bool _licenseValid{ false };
bool _isInitialized{ false };