video_recognizer.h¶
-
struct mmdeploy_video_recognition_t¶
-
struct mmdeploy_video_sample_info_t¶
-
typedef struct mmdeploy_video_recognizer *mmdeploy_video_recognizer_t¶
-
int mmdeploy_video_recognizer_create(mmdeploy_model_t model, const char *device_name, int device_id, mmdeploy_video_recognizer_t *recognizer)¶
Create video recognizer’s handle.
- 参数
model – [in] an instance of mmaction sdk model created by mmdeploy_model_create_by_path or mmdeploy_model_create in model.h
device_name – [in] name of device, such as “cpu”, “cuda”, etc.
device_id – [in] id of device.
recognizer – [out] handle of the created video recognizer, which must be destroyed by mmdeploy_video_recognizer_destroy
- 返回
status of creating video recognizer’s handle
-
int mmdeploy_video_recognizer_create_by_path(const char *model_path, const char *device_name, int device_id, mmdeploy_video_recognizer_t *recognizer)¶
Create a video recognizer instance.
- 参数
model_path – [in] path to video recognition model
device_name – [in] name of device, such as “cpu”, “cuda”, etc.
device_id – [in] id of device.
recognizer – [out] handle of the created video recognizer, which must be destroyed by mmdeploy_video_recognizer_destroy
- 返回
status code of the operation
-
int mmdeploy_video_recognizer_apply(mmdeploy_video_recognizer_t recognizer, const mmdeploy_mat_t *images, const mmdeploy_video_sample_info_t *video_info, int video_count, mmdeploy_video_recognition_t **results, int **result_count)¶
Apply video recognizer to a batch of videos.
- 参数
recognizer – [in] video recognizer’s handle created by mmdeploy_video_recognizer_create_by_path
images – [in] a batch of videos
video_info – [in] video information of each video
video_count – [in] number of videos
results – [out] a linear buffer contains the recognized video, must be release by mmdeploy_video_recognizer_release_result
result_count – [out] a linear buffer with length being
video_count
to save the number of recognition results of each video. It must be released by mmdeploy_video_recognizer_release_result
- 返回
status code of the operation
-
void mmdeploy_video_recognizer_release_result(mmdeploy_video_recognition_t *results, int *result_count, int video_count)¶
Release result buffer returned by mmdeploy_video_recognizer_apply.
- 参数
results – [in] result buffer by video recognizer
result_count – [in]
results
size buffervideo_count – [in] length of
result_count
-
void mmdeploy_video_recognizer_destroy(mmdeploy_video_recognizer_t recognizer)¶
destroy video recognizer
- 参数
recognizer – [in] handle of video recognizer created by mmdeploy_video_recognizer_create_by_path or mmdeploy_video_recognizer_create
-
int mmdeploy_video_recognizer_create_v2(mmdeploy_model_t model, mmdeploy_context_t context, mmdeploy_video_recognizer_t *recognizer)¶
Same as mmdeploy_video_recognizer_create, but allows to control execution context of tasks via context.
-
int mmdeploy_video_recognizer_create_input(const mmdeploy_mat_t *images, const mmdeploy_video_sample_info_t *video_info, int video_count, mmdeploy_value_t *value)¶
Pack video recognizer inputs into mmdeploy_value_t.
- 参数
images – [in] a batch of videos
video_info – [in] video information of each video
video_count – [in] number of videos in the batch
value – [out] created value
- 返回
status code of the operation
-
int mmdeploy_video_recognizer_apply_v2(mmdeploy_video_recognizer_t recognizer, mmdeploy_value_t input, mmdeploy_value_t *output)¶
Apply video recognizer to a batch of videos.
- 参数
input – [in] packed input
output – [out] inference output
- 返回
status code of the operation
-
int mmdeploy_video_recognizer_get_result(mmdeploy_value_t output, mmdeploy_video_recognition_t **results, int **result_count)¶
Apply video recognizer to a batch of videos.
- 参数
output – [in] inference output
results – [out] structured output
result_count – [out] number of each videos
- 返回
status code of the operation