1 /* 2 * Copyright (C) 2021-2023 Alibaba Group Holding Limited 3 */ 4 5 #include <stdio.h> 6 #include <string.h> 7 #include "ucloud_ai_common.h" 8 9 #define TAG "UCLOUD_AI_IMAGESEG" 10 ucloud_ai_imageseg_segment_face(char * path,ucloud_ai_cb_t cb)11void ucloud_ai_imageseg_segment_face(char *path, ucloud_ai_cb_t cb) 12 { 13 int len; 14 char *p_upload_url; 15 16 /*update capture.jpg to oss*/ 17 p_upload_url = ucloud_ai_upload_file(path); 18 if (!p_upload_url) 19 return; 20 21 /*do face segment*/ 22 segmentFace(p_upload_url, cb); 23 free(p_upload_url); 24 } 25 ucloud_ai_imageseg_segment_common_image(char * path,ucloud_ai_cb_t cb)26void ucloud_ai_imageseg_segment_common_image(char *path, ucloud_ai_cb_t cb) 27 { 28 int ret; 29 int len; 30 char *p_upload_url; 31 32 /*update capture.jpg to oss*/ 33 p_upload_url = ucloud_ai_upload_file(path); 34 if (!p_upload_url) 35 return; 36 37 /*do common image segement*/ 38 segmentCommonImage(p_upload_url, cb); 39 free(p_upload_url); 40 } 41