You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MDToDApi.h 2.5 kB

5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef DATASET_MDTODAPI_H_
  17. #define DATASET_MDTODAPI_H_
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. class MDToDApi;
  21. typedef struct MDToDBuff {
  22. void *Buff;
  23. size_t DataSize;
  24. size_t TensorSize[4];
  25. size_t MaxBuffSize;
  26. } MDToDBuff_t;
  27. typedef struct MDToDConf {
  28. const char *pFolderPath;
  29. const char *pSchemFile;
  30. const char *pStoragePath;
  31. MDToDBuff_t columnsToReadBuff;
  32. float MEAN[3];
  33. float STD[3];
  34. int ResizeSizeWH[2];
  35. int fixOrientation;
  36. int CropSizeWH[2];
  37. int64_t fileid; // -1 All files, otherwise get a single specifc file
  38. } MDToDConf_t;
  39. typedef struct MDToDResult {
  40. int64_t fileid;
  41. int32_t isForTrain;
  42. int32_t noOfFaces;
  43. int32_t orientation;
  44. MDToDBuff_t fileNameBuff;
  45. MDToDBuff_t labelBuff;
  46. MDToDBuff_t imageBuff;
  47. MDToDBuff_t embeddingBuff;
  48. MDToDBuff_t boundingBoxesBuff;
  49. MDToDBuff_t confidencesBuff;
  50. MDToDBuff_t landmarksBuff;
  51. MDToDBuff_t faceFileNamesBuff;
  52. MDToDBuff_t imageQualitiesBuff;
  53. MDToDBuff_t faceEmbeddingsBuff;
  54. } MDToDResult_t;
  55. typedef int (*MDToDApi_pathTest_t)(const char *path);
  56. typedef int (*MDToDApi_testAlbum_t)();
  57. typedef MDToDApi *(*MDToDApi_createPipeLine_t)(MDToDConf_t MDConf);
  58. typedef int (*MDToDApi_GetNext_t)(MDToDApi *pMDToDApi, MDToDResult_t *results);
  59. typedef int (*MDToDApi_UpdateEmbeding_t)(MDToDApi *pMDToDApi, const char *column, float *emmbeddings,
  60. size_t emmbeddingsSize);
  61. typedef int (*MDToDApi_UpdateStringArray_t)(MDToDApi *pMDToDApi, const char *column, MDToDBuff_t MDbuff);
  62. typedef int (*MDToDApi_UpdateFloatArray_t)(MDToDApi *pMDToDApi, const char *column, MDToDBuff_t MDbuff);
  63. typedef int (*MDToDApi_UpdateIsForTrain_t)(MDToDApi *pMDToDApi, uint8_t isForTrain);
  64. typedef int (*MDToDApi_UpdateNoOfFaces_t)(MDToDApi *pMDToDApi, int32_t noOfFaces);
  65. typedef int (*MDToDApi_Stop_t)(MDToDApi *pMDToDApi);
  66. typedef int (*MDToDApi_Destroy_t)(MDToDApi *pMDToDApi);
  67. #endif