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
+11 -1
View File
@@ -16,6 +16,13 @@ namespace ANSCENTER
class ANSENGINE_API ANSONNXSAM3 : public ANSODBase
{
public:
// Explicit non-copy/non-move (see ANSONNXYOLO for dllexport rationale).
ANSONNXSAM3(const ANSONNXSAM3&) = delete;
ANSONNXSAM3& operator=(const ANSONNXSAM3&) = delete;
ANSONNXSAM3(ANSONNXSAM3&&) = delete;
ANSONNXSAM3& operator=(ANSONNXSAM3&&) = delete;
ANSONNXSAM3() = default;
virtual bool Initialize(std::string licenseKey, ModelConfig modelConfig,
const std::string& modelZipFilePath, const std::string& modelZipPassword,
std::string& labelMap) override;
@@ -45,7 +52,10 @@ namespace ANSCENTER
bool _fp16 = false;
// ONNX Runtime engine
std::unique_ptr<ONNXSAM3> m_engine;
// Elaborated `class ONNXSAM3` disambiguates from the
// ANSCENTER::ModelType::ONNXSAM3 enumerator (ANSLicense.h) which
// shares the same unqualified name in this namespace.
std::unique_ptr<class ONNXSAM3> m_engine;
// Tokenizer (loaded from merges.txt)
std::unique_ptr<ANSCLIPTokenizer> m_tokenizer;