ucloud_ai_common.h
浏览该文件的文档.
1 /*
2  * Copyright (C) 2020-2023 Alibaba Group Holding Limited
3  */
4 
5 #ifndef _UCLOUD_AI_COMMON_H_
6 #define _UCLOUD_AI_COMMON_H_
7 #include "model/common.h"
8 #include "oss_app.h"
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 
15 
16 #define FACE1_IMAGE "/data/ucloud_ai_image/face1.png"
17 #define FACE2_IMAGE "/data/ucloud_ai_image/face2.png"
18 #define ANIME_IMAGE "/data/ucloud_ai_image/expression.jpg"
19 #define EXPRESSION_IMAGE "/data/ucloud_ai_image/expression.jpg"
20 #define OBJECT_IMAGE "/data/ucloud_ai_image/object.jpg"
21 #define MAINBODY_IMAGE "/data/ucloud_ai_image/face1.png"
22 #define CARD_FACE_IMAGE "/data/ucloud_ai_image/card_face.jpg"
23 #define CARD_BACK_IMAGE "/data/ucloud_ai_image/card_back.jpg"
24 #define BANK_CARD_IMAGE "/data/ucloud_ai_image/bank_card.jpg"
25 #define CHARACTER_IMAGE "/data/ucloud_ai_image/character.jpg"
26 #define RUBBISH_IMAGE "/data/ucloud_ai_image/rubbish.jpg"
27 #define FRUITS_IMAGE "/data/ucloud_ai_image/fruits.jpg"
28 #define PERSON_ORG_IMAGE "/data/ucloud_ai_image/person_org.jpg"
29 #define STYLE_IMAGE "/data/ucloud_ai_image/person_org.jpg"
30 
31 // imageenhan style url
32 #define IMAGEENHAN_ERASE_PERSON_USERMASK_URL "http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageenhan/ErasePerson/ErasePerson6.jpg"
33 #define IMAGEENHAN_EXTEND_IMAGE_STYLE_URL "http://ivpd-demo.oss-cn-shanghai.aliyuncs.com/ivpd-demo/images/ExtendImageStyle/styleUrl.jpeg"
34 
35 typedef AIModelCBFunc ucloud_ai_cb_t;
36 typedef AIModelResultStruct ucloud_ai_result_t;
37 
38 typedef enum _ucloud_ai_model_t {
39  UCLOUD_AI_MODEL_COMPARING_FACEBODY, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.59.bc2e797dbbIyZQ&tagName=facebody&children=CompareFace
40  UCLOUD_AI_MODEL_GENERATE_HUMAN_ANIME_STYLE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.15.54ca797dDKkjDk&tagName=facebody&children=GenerateHumanAnimeStyle
41  UCLOUD_AI_MODEL_RECOGNIZE_EXPRESSION, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.10.4e1a797dHZHzS5&tagName=facebody&children=RecognizeExpression
42  UCLOUD_AI_MODEL_DETECT_PEDSTRIAN, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.35.15b8797dPuaXsj&tagName=facebody&children=DetectPedestrian
43  UCLOUD_AI_MODEL_DETECT_OBJECT, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.20.2074797dOvJ4L2&tagName=objectdet&children=DetectObject
44  UCLOUD_AI_MODEL_DETECT_MAIN_BODY, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.23.61df797dKC0yXR&tagName=objectdet&children=DetectMainBody
45  UCLOUD_AI_MODEL_SEGMENT_COMMON_IMAGE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.6.7d9e797dL51BIO&tagName=imageseg&children=SegmentCommonImage
46  UCLOUD_AI_MODEL_SEGMENT_FACE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.22.9e3a797deY528B&tagName=imageseg&children=SegmentFace
47  UCLOUD_AI_MODEL_RECOGNIZE_IDENTITY_CARD_FACE_SIDE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.16.7d87797d2vHJJ9&tagName=ocr&children=RecognizeIdentityCard
48  UCLOUD_AI_MODEL_RECOGNIZE_IDENTITY_CARD_BACK_SIDE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.16.7d87797d2vHJJ9&tagName=ocr&children=RecognizeIdentityCard
49  UCLOUD_AI_MODEL_RECOGNIZE_BANK_CARD, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.20.63cd797d7APYEE&tagName=ocr&children=RecognizeBankCard
50  UCLOUD_AI_MODEL_RECOGNIZE_CHARACTER, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14020179.J_7524944390.6.66cd608dJkkY48&tagName=ocr&children=RecognizeCharacter
51  UCLOUD_AI_MODEL_RECOGNIZE_LICENCE_PLATE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.13.73f5797d26kqtB&tagName=ocr&children=RecognizeLicensePlate
52  UCLOUD_AI_MODEL_CLASSIFYING_RUBBISH, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.13.73f5797dHFaJxR&tagName=imagerecog&children=ClassifyingRubbish
53  UCLOUD_AI_MODEL_DETECT_FRUITS, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14020179.J_7524944390.44.66cd608dt39mQW&tagName=imagerecog&children=DetectFruits
54  UCLOUD_AI_MODEL_ERASE_PERSON, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.6.6c49797dKzzl8D&tagName=imageenhan&children=ErasePerson, have some unknown issue
55  UCLOUD_AI_MODEL_EXTEND_IMAGE_STYLE, // refer to https://vision.aliyun.com/experience/detail?spm=a211p3.14471187.J_7524944390.18.6c49797dKzzl8D&tagName=imageenhan&children=ExtendImageStyle
58 
70 void ucloud_ai_set_key_secret(char *key, char *secret);
71 
78 void ucloud_ai_set_oss_bucket(char *bucket);
79 
86 void ucloud_ai_set_oss_endpoint(char *endpoint);
87 
95 uint8_t *ucloud_ai_upload_file(char *path);
96 
102 int32_t ucloud_ai_init(void);
103 
109 int32_t ucloud_ai_uninit(void);
110 
118 int32_t ucloud_ai_connect(char *url);
119 
125 
130 int32_t ucloud_ai_get_stream(char *url, char **stream);
136 char *ucloud_ai_get_token_id(const char *domain, const char *region_id);
140 #ifdef __cplusplus
141 }
142 #endif
143 #endif // _UCLOUD_AI_COMMON_H_
int32_t ucloud_ai_uninit(void)
int32_t ucloud_ai_get_stream(char *url, char **stream)
uint8_t * ucloud_ai_upload_file(char *path)
char * ucloud_ai_get_token_id(const char *domain, const char *region_id)
void ucloud_ai_set_key_secret(char *key, char *secret)
void ucloud_ai_disconnect(void)
int32_t ucloud_ai_connect(char *url)
int32_t ucloud_ai_init(void)
void ucloud_ai_set_oss_endpoint(char *endpoint)
void ucloud_ai_set_oss_bucket(char *bucket)
AIModelResultStruct ucloud_ai_result_t
enum _ucloud_ai_model_t ucloud_ai_model_t
AIModelCBFunc ucloud_ai_cb_t
_ucloud_ai_model_t
@ UCLOUD_AI_MODEL_RECOGNIZE_EXPRESSION
@ UCLOUD_AI_MODEL_GENERATE_HUMAN_ANIME_STYLE
@ UCLOUD_AI_MODEL_RECOGNIZE_BANK_CARD
@ UCLOUD_AI_MODEL_DETECT_OBJECT
@ UCLOUD_AI_MODEL_DETECT_PEDSTRIAN
@ UCLOUD_AI_MODEL_RECOGNIZE_CHARACTER
@ UCLOUD_AI_MODEL_RECOGNIZE_IDENTITY_CARD_BACK_SIDE
@ UCLOUD_AI_MODEL_SEGMENT_COMMON_IMAGE
@ UCLOUD_AI_MODEL_ERASE_PERSON
@ UCLOUD_AI_MODEL_DETECT_FRUITS
@ UCLOUD_AI_MODEL_RECOGNIZE_LICENCE_PLATE
@ UCLOUD_AI_MODEL_CLASSIFYING_RUBBISH
@ UCLOUD_AI_MODEL_SEGMENT_FACE
@ UCLOUD_AI_MODEL_EXTEND_IMAGE_STYLE
@ UCLOUD_AI_MODEL_MAX
@ UCLOUD_AI_MODEL_COMPARING_FACEBODY
@ UCLOUD_AI_MODEL_RECOGNIZE_IDENTITY_CARD_FACE_SIDE
@ UCLOUD_AI_MODEL_DETECT_MAIN_BODY