document async APIs as experimental (#575)

pull/577/head
Li Zhang 2022-06-08 18:56:42 +08:00 committed by GitHub
parent 59ed27e2f3
commit d1e6155b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 83 additions and 55 deletions

View File

@ -76,6 +76,9 @@ MMDEPLOY_API void mmdeploy_classifier_release_result(mm_class_t* results, const
*/
MMDEPLOY_API void mmdeploy_classifier_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
/**
* @brief Same as \ref mmdeploy_classifier_create, but allows to control execution context of tasks
* via exec_info

View File

@ -80,6 +80,9 @@ MMDEPLOY_API void mmdeploy_detector_release_result(mm_detect_t* results, const i
*/
MMDEPLOY_API void mmdeploy_detector_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
/**
* @brief Same as \ref mmdeploy_detector_create, but allows to control execution context of tasks
* via exec_info

View File

@ -9,6 +9,9 @@
extern "C" {
#endif
/******************************************************************************
* Experimental asynchronous APIs */
typedef mmdeploy_value_t (*mmdeploy_then_fn_t)(mmdeploy_value_t, void*);
typedef mmdeploy_value_t (*mmdeploy_then_fn_v2_t)(mmdeploy_value_t*, void*);

View File

@ -6,12 +6,13 @@
#include "common.h"
#include "executor.h"
// experimental pipeline API
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* Experimental pipeline APIs */
/**
* @brief Create pipeline
* @param[in] config config of the pipeline

View File

@ -91,6 +91,9 @@ MMDEPLOY_API void mmdeploy_pose_detector_release_result(mm_pose_detect_t* result
*/
MMDEPLOY_API void mmdeploy_pose_detector_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
MMDEPLOY_API int mmdeploy_pose_detector_create_v2(mm_model_t model, const char* device_name,
int device_id, mmdeploy_exec_info_t exec_info,
mm_handle_t* handle);

View File

@ -64,6 +64,9 @@ MMDEPLOY_API void mmdeploy_restorer_release_result(mm_mat_t* results, int count)
*/
MMDEPLOY_API void mmdeploy_restorer_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
MMDEPLOY_API int mmdeploy_restorer_create_v2(mm_model_t model, const char* device_name,
int device_id, mmdeploy_exec_info_t exec_info,
mm_handle_t* handle);

View File

@ -76,6 +76,9 @@ MMDEPLOY_API void mmdeploy_rotated_detector_release_result(mm_rotated_detect_t*
*/
MMDEPLOY_API void mmdeploy_rotated_detector_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
/**
* @brief Same as \ref mmdeploy_detector_create, but allows to control execution context of tasks
* via exec_info

View File

@ -74,6 +74,9 @@ MMDEPLOY_API void mmdeploy_segmentor_release_result(mm_segment_t* results, int c
*/
MMDEPLOY_API void mmdeploy_segmentor_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
MMDEPLOY_API int mmdeploy_segmentor_create_v2(mm_model_t model, const char* device_name,
int device_id, mmdeploy_exec_info_t exec_info,
mm_handle_t* handle);

View File

@ -76,6 +76,9 @@ MMDEPLOY_API void mmdeploy_text_detector_release_result(mm_text_detect_t* result
*/
MMDEPLOY_API void mmdeploy_text_detector_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
/**
* @brief Same as \ref mmdeploy_text_detector_create, but allows to control execution context of
* tasks via exec_info

View File

@ -35,14 +35,6 @@ typedef struct mm_text_recognize_t {
MMDEPLOY_API int mmdeploy_text_recognizer_create(mm_model_t model, const char* device_name,
int device_id, mm_handle_t* handle);
/**
* @brief Same as \ref mmdeploy_text_recognizer_create, but allows to control execution context of
* tasks via exec_info
*/
MMDEPLOY_API int mmdeploy_text_recognizer_create_v2(mm_model_t model, const char* device_name,
int device_id, mmdeploy_exec_info_t exec_info,
mm_handle_t* handle);
/**
* @brief Create a text recognizer instance
* @param[in] model_path path to text recognition model
@ -56,19 +48,6 @@ MMDEPLOY_API int mmdeploy_text_recognizer_create_by_path(const char* model_path,
const char* device_name, int device_id,
mm_handle_t* handle);
/**
* @brief Pack text-recognizer inputs into mmdeploy_value_t
* @param[in] images a batch of images
* @param[in] image_count number of images in the batch
* @param[in] bboxes bounding boxes detected by text detector
* @param[in] bbox_count number of bboxes of each \p images, must be same length as \p images
* @return value created
*/
MMDEPLOY_API int mmdeploy_text_recognizer_create_input(const mm_mat_t* images, int image_count,
const mm_text_detect_t* bboxes,
const int* bbox_count,
mmdeploy_value_t* output);
/**
* @brief Apply text recognizer to a batch of text images
* @param[in] handle text recognizer's handle created by \ref
@ -82,6 +61,62 @@ MMDEPLOY_API int mmdeploy_text_recognizer_create_input(const mm_mat_t* images, i
MMDEPLOY_API int mmdeploy_text_recognizer_apply(mm_handle_t handle, const mm_mat_t* images,
int count, mm_text_recognize_t** results);
/**
* @brief Apply text recognizer to a batch of images supplied with text bboxes
* @param[in] handle text recognizer's handle created by \ref
* mmdeploy_text_recognizer_create_by_path
* @param[in] images a batch of text images
* @param[in] image_count number of images in the batch
* @param[in] bboxes bounding boxes detected by text detector
* @param[in] bbox_count number of bboxes of each \p images, must be same length as \p images
* @param[out] results a linear buffer contains the recognized text, which has the same length as \p
* bboxes, must be release by \ref mmdeploy_text_recognizer_release_result
* @return status code of the operation
*/
MMDEPLOY_API int mmdeploy_text_recognizer_apply_bbox(mm_handle_t handle, const mm_mat_t* images,
int image_count,
const mm_text_detect_t* bboxes,
const int* bbox_count,
mm_text_recognize_t** results);
/** @brief Release result buffer returned by \ref mmdeploy_text_recognizer_apply or \ref
* mmdeploy_text_recognizer_apply_bbox
* @param[in] results result buffer by text recognizer
* @param[in] count length of \p result
*/
MMDEPLOY_API void mmdeploy_text_recognizer_release_result(mm_text_recognize_t* results, int count);
/**
* @brief destroy text recognizer
* @param[in] handle handle of text recognizer created by \ref
* mmdeploy_text_recognizer_create_by_path or \ref mmdeploy_text_recognizer_create
*/
MMDEPLOY_API void mmdeploy_text_recognizer_destroy(mm_handle_t handle);
/******************************************************************************
* Experimental asynchronous APIs */
/**
* @brief Same as \ref mmdeploy_text_recognizer_create, but allows to control execution context of
* tasks via exec_info
*/
MMDEPLOY_API int mmdeploy_text_recognizer_create_v2(mm_model_t model, const char* device_name,
int device_id, mmdeploy_exec_info_t exec_info,
mm_handle_t* handle);
/**
* @brief Pack text-recognizer inputs into mmdeploy_value_t
* @param[in] images a batch of images
* @param[in] image_count number of images in the batch
* @param[in] bboxes bounding boxes detected by text detector
* @param[in] bbox_count number of bboxes of each \p images, must be same length as \p images
* @return value created
*/
MMDEPLOY_API int mmdeploy_text_recognizer_create_input(const mm_mat_t* images, int image_count,
const mm_text_detect_t* bboxes,
const int* bbox_count,
mmdeploy_value_t* output);
MMDEPLOY_API int mmdeploy_text_recognizer_apply_v2(mm_handle_t handle, mmdeploy_value_t input,
mmdeploy_value_t* output);
@ -105,24 +140,6 @@ MMDEPLOY_API int mmdeploy_text_recognizer_continue_async(mmdeploy_sender_t input
mmdeploy_text_recognizer_continue_t cont,
void* context, mmdeploy_sender_t* output);
/**
* @brief Apply text recognizer to a batch of images supplied with text bboxes
* @param[in] handle text recognizer's handle created by \ref
* mmdeploy_text_recognizer_create_by_path
* @param[in] images a batch of text images
* @param[in] image_count number of images in the batch
* @param[in] bboxes bounding boxes detected by text detector
* @param[in] bbox_count number of bboxes of each \p images, must be same length as \p images
* @param[out] results a linear buffer contains the recognized text, which has the same length as \p
* bboxes, must be release by \ref mmdeploy_text_recognizer_release_result
* @return status code of the operation
*/
MMDEPLOY_API int mmdeploy_text_recognizer_apply_bbox(mm_handle_t handle, const mm_mat_t* images,
int image_count,
const mm_text_detect_t* bboxes,
const int* bbox_count,
mm_text_recognize_t** results);
/**
* @brief Unpack text-recognizer output from a mmdeploy_value_t
* @param[in] output
@ -132,20 +149,6 @@ MMDEPLOY_API int mmdeploy_text_recognizer_apply_bbox(mm_handle_t handle, const m
MMDEPLOY_API int mmdeploy_text_recognizer_get_result(mmdeploy_value_t output,
mm_text_recognize_t** results);
/** @brief Release result buffer returned by \ref mmdeploy_text_recognizer_apply or \ref
* mmdeploy_text_recognizer_apply_bbox
* @param[in] results result buffer by text recognizer
* @param[in] count length of \p result
*/
MMDEPLOY_API void mmdeploy_text_recognizer_release_result(mm_text_recognize_t* results, int count);
/**
* @brief destroy text recognizer
* @param[in] handle handle of text recognizer created by \ref
* mmdeploy_text_recognizer_create_by_path or \ref mmdeploy_text_recognizer_create
*/
MMDEPLOY_API void mmdeploy_text_recognizer_destroy(mm_handle_t handle);
#ifdef __cplusplus
}
#endif