ClipAPI.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "DetectorAPI.h"
  2. #include "ClipDetector.h"
  3. SDKAPI TZ_INT Initialize()
  4. {
  5. return masd::MEC_OK;
  6. }
  7. SDKAPI TZ_INT Dispose()
  8. {
  9. return masd::MEC_OK;
  10. }
  11. SDKAPI masd::Detector* BuildDetector()
  12. {
  13. masd::Detector* det = new masd::clip::ClipDetector("Clip", "Clip检测");
  14. return det;
  15. }
  16. SDKAPI void DestroyDetector(masd::Detector* detector)
  17. {
  18. TZ_delete(detector);
  19. }
  20. SDKAPI TZ_INT GetInformation(TZ_CHAR* information)
  21. {
  22. masd::DetectorInfo info;
  23. info.Key = "Clip";
  24. info.Name = "Clip检测";
  25. info.Version = "V1.0.0-T-20241214R";
  26. info.Author = "杭州晨鹰军泰";
  27. info.UpdateDate = "2024-12-14 09:30:00";
  28. info.InputType = masd::EN_BUFFER_TYPE::MRT_BGR;
  29. masd::clip::ClipDetectResult rstInfo;
  30. masd::clip::OutputData data;
  31. rstInfo.output_data.push_back(data);
  32. info.RstTemp = rstInfo.toJson();
  33. std::vector<masd::DetectCfg> buildInfos;
  34. buildInfos.emplace_back(masd::DIT_INT, "gpu_id", "GPU ID", "0", "0", "0", "0");
  35. buildInfos.emplace_back(masd::DIT_STRING, "model_path", "YOLO模型路径", PROGRAM_ROOT_PATH "models/visual.onnx", "NAN", "NAN", "NAN");
  36. info.BuildTemp = tzc::json::ArrayToJson(buildInfos);
  37. info.AreaTemp = "[focus, ignore]";
  38. info.InitParam = "{\"gpu_id\": 0,\"model_path\": \"" PROGRAM_ROOT_PATH "models/visual.onnx\"}";
  39. strcpy(information, info.toJson().c_str());
  40. return masd::MEC_OK;
  41. }