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.6 kB

5 years ago
5 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. namespace mindspore {
  21. class MDToDApi;
  22. typedef struct MDToDBuff {
  23. void *Buff;
  24. size_t DataSize;
  25. size_t TensorSize[4];
  26. size_t MaxBuffSize;
  27. } MDToDBuff_t;
  28. typedef struct MDToDConf {
  29. const char *pFolderPath;
  30. const char *pSchemFile;
  31. const char *pStoragePath;
  32. MDToDBuff_t columnsToReadBuff;
  33. float MEAN[3];
  34. float STD[3];
  35. int ResizeSizeWH[2];
  36. int fixOrientation;
  37. int CropSizeWH[2];
  38. int64_t fileid; // -1 All files, otherwise get a single specific file
  39. } MDToDConf_t;
  40. typedef struct MDToDResult {
  41. int64_t fileid;
  42. int32_t isForTrain;
  43. int32_t noOfFaces;
  44. int32_t orientation;
  45. MDToDBuff_t fileNameBuff;
  46. MDToDBuff_t labelBuff;
  47. MDToDBuff_t imageBuff;
  48. MDToDBuff_t embeddingBuff;
  49. MDToDBuff_t boundingBoxesBuff;
  50. MDToDBuff_t confidencesBuff;
  51. MDToDBuff_t landmarksBuff;
  52. MDToDBuff_t faceFileNamesBuff;
  53. MDToDBuff_t imageQualitiesBuff;
  54. MDToDBuff_t faceEmbeddingsBuff;
  55. } MDToDResult_t;
  56. } // namespace mindspore
  57. using (*MDToDApi_pathTest_t)(const char *path) = int;
  58. using (*MDToDApi_testAlbum_t)() = int;
  59. using *(*MDToDApi_createPipeLine_t)(MDToDConf_t MDConf) = MDToDApi;
  60. using (*MDToDApi_GetNext_t)(MDToDApi *pMDToDApi, MDToDResult_t *results) = int;
  61. using (*MDToDApi_UpdateEmbeding_t)(MDToDApi *pMDToDApi, const char *column, float *emmbeddings,
  62. size_t emmbeddingsSize) = int;
  63. using (*MDToDApi_UpdateStringArray_t)(MDToDApi *pMDToDApi, const char *column, MDToDBuff_t MDbuff) = int;
  64. using (*MDToDApi_UpdateFloatArray_t)(MDToDApi *pMDToDApi, const char *column, MDToDBuff_t MDbuff) = int;
  65. using (*MDToDApi_UpdateIsForTrain_t)(MDToDApi *pMDToDApi, uint8_t isForTrain) = int;
  66. using (*MDToDApi_UpdateNoOfFaces_t)(MDToDApi *pMDToDApi, int32_t noOfFaces) = int;
  67. using (*MDToDApi_Stop_t)(MDToDApi *pMDToDApi) = int;
  68. using (*MDToDApi_Destroy_t)(MDToDApi *pMDToDApi) = int;
  69. #endif