#ifndef ANSCUSTOMDETECTOR_H
#define ANSCUSTOMDETECTOR_H
#pragma once
#include "ANSCustomCode.h"
#include "ANSEngineCommon.h"
typedef IANSCustomClass* (*CreatePluginFunc)();
namespace ANSCENTER {
    class ANSENGINE_API ANSCUSTOMDETECTOR :public ANSODBase {
    public:
        virtual bool Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) override;
        virtual bool LoadModel(const std::string& modelZipFilePath, const std::string& modelZipPassword)override;
        virtual bool LoadModelFromFolder(std::string licenseKey, ModelConfig modelConfig, std::string modelName, std::string className,const std::string& modelFolder, std::string& labelMap)override;
        virtual bool ConfigureParameters(Params& param) override;
        virtual bool SetParameters(const Params& param)override;
        virtual bool OptimizeModel(bool fp16, std::string& optimizedModelFolder);
        std::vector<Object> RunInference(const cv::Mat& input);
        std::vector<Object> RunInference(const cv::Mat& input, const std::string& camera_id); 

        bool Destroy();
        ~ANSCUSTOMDETECTOR();
    private:
        std::string     _modelFilePath;
        std::string     _modelCfgPath;
        std::unique_ptr<IANSCustomClass> _customDetector;
        HMODULE hMod= nullptr;
		std::string FindANSCustomLibraryName(const std::string& folderPath, const std::string& keyword);
        bool CreateCustomDetector();  
    };
}
#endif