#include "DetectorAPI.h" #include "ClipDetector.h" SDKAPI TZ_INT Initialize() { return masd::MEC_OK; } SDKAPI TZ_INT Dispose() { return masd::MEC_OK; } SDKAPI masd::Detector* BuildDetector() { masd::Detector* det = new masd::clip::ClipDetector("Clip", "Clip检测"); return det; } SDKAPI void DestroyDetector(masd::Detector* detector) { TZ_delete(detector); } SDKAPI TZ_INT GetInformation(TZ_CHAR* information) { masd::DetectorInfo info; info.Key = "Clip"; info.Name = "Clip检测"; info.Version = "V1.0.0-T-20241214R"; info.Author = "杭州晨鹰军泰"; info.UpdateDate = "2024-12-14 09:30:00"; info.InputType = masd::EN_BUFFER_TYPE::MRT_BGR; masd::clip::ClipDetectResult rstInfo; masd::clip::OutputData data; rstInfo.output_data.push_back(data); info.RstTemp = rstInfo.toJson(); std::vector buildInfos; buildInfos.emplace_back(masd::DIT_INT, "gpu_id", "GPU ID", "0", "0", "0", "0"); buildInfos.emplace_back(masd::DIT_STRING, "model_path", "YOLO模型路径", PROGRAM_ROOT_PATH "models/visual.onnx", "NAN", "NAN", "NAN"); info.BuildTemp = tzc::json::ArrayToJson(buildInfos); info.AreaTemp = "[focus, ignore]"; info.InitParam = "{\"gpu_id\": 0,\"model_path\": \"" PROGRAM_ROOT_PATH "models/visual.onnx\"}"; strcpy(information, info.toJson().c_str()); return masd::MEC_OK; }