Initial commit to add all 3 custom projects
This commit is contained in:
33
ANSCustomHelmetDetection/ANSCustomCodeHelmetDetection.h
Normal file
33
ANSCustomHelmetDetection/ANSCustomCodeHelmetDetection.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "ANSLIB.h"
|
||||
|
||||
//#define FNS_DEBUG
|
||||
class CUSTOM_API ANSCustomHMD : public IANSCustomClass
|
||||
{
|
||||
private:
|
||||
using ANSLIBPtr = std::unique_ptr<ANSCENTER::ANSLIB, decltype(&ANSCENTER::ANSLIB::Destroy)>;
|
||||
|
||||
std::recursive_mutex _mutex;
|
||||
int engineType{ 0 };
|
||||
ANSLIBPtr _detector{ nullptr, &ANSCENTER::ANSLIB::Destroy };
|
||||
ANSLIBPtr _classifier{ nullptr, &ANSCENTER::ANSLIB::Destroy };
|
||||
|
||||
// ----- Model config -----
|
||||
int _detectorModelType;
|
||||
int _detectorDetectionType;
|
||||
int _classifierModelType;
|
||||
int _classifierDetectionType;
|
||||
|
||||
std::string _classifierLabels;
|
||||
bool _isInitialized{ false };
|
||||
bool _readROIs{ false };
|
||||
|
||||
public:
|
||||
bool Initialize(const std::string& modelDiretory, float detectionScoreThreshold, std::string& labelMap) override;
|
||||
bool OptimizeModel(bool fp16) override;
|
||||
bool ConfigureParameters(CustomParams& param) override;
|
||||
std::vector<CustomObject> RunInference(const cv::Mat& input) override;
|
||||
std::vector<CustomObject> RunInference(const cv::Mat& input, const std::string& camera_id) override;
|
||||
bool Destroy() override;
|
||||
ANSCustomHMD();
|
||||
~ANSCustomHMD();
|
||||
};
|
||||
Reference in New Issue
Block a user