Shortcuts

classifier.h

struct mmdeploy_classification_t

Public Members

int label_id
float score
typedef struct mmdeploy_classifier *mmdeploy_classifier_t
int mmdeploy_classifier_create(mmdeploy_model_t model, const char *device_name, int device_id, mmdeploy_classifier_t *classifier)

Create classifier’s handle.

Parameters
Returns

status of creating classifier’s handle

int mmdeploy_classifier_create_by_path(const char *model_path, const char *device_name, int device_id, mmdeploy_classifier_t *classifier)

Create classifier’s handle.

Parameters
  • model_path[in] path of mmclassification sdk model exported by mmdeploy model converter

  • device_name[in] name of device, such as “cpu”, “cuda”, etc.

  • device_id[in] id of device.

  • classifier[out] instance of a classifier, which must be destroyed by mmdeploy_classifier_destroy

Returns

status of creating classifier’s handle

int mmdeploy_classifier_apply(mmdeploy_classifier_t classifier, const mmdeploy_mat_t *mats, int mat_count, mmdeploy_classification_t **results, int **result_count)

Use classifier created by mmdeploy_classifier_create_by_path to get label information of each image in a batch.

Parameters
Returns

status of inference

void mmdeploy_classifier_release_result(mmdeploy_classification_t *results, const int *result_count, int count)

Release the inference result buffer created mmdeploy_classifier_apply.

Parameters
  • results[in] classification results buffer

  • result_count[in] results size buffer

  • count[in] length of result_count

void mmdeploy_classifier_destroy(mmdeploy_classifier_t classifier)

Destroy classifier’s handle.

Parameters

classifier[in] classifier’s handle created by mmdeploy_classifier_create_by_path

int mmdeploy_classifier_create_v2(mmdeploy_model_t model, mmdeploy_context_t context, mmdeploy_classifier_t *classifier)

Same as mmdeploy_classifier_create, but allows to control execution context of tasks via context.

int mmdeploy_classifier_create_input(const mmdeploy_mat_t *mats, int mat_count, mmdeploy_value_t *value)

Pack classifier inputs into mmdeploy_value_t.

Parameters
  • mats[in] a batch of images

  • mat_count[in] number of images in the batch

  • value[out] the packed value

Returns

status of the operation

int mmdeploy_classifier_apply_v2(mmdeploy_classifier_t classifier, mmdeploy_value_t input, mmdeploy_value_t *output)

Same as mmdeploy_classifier_apply, but input and output are packed in mmdeploy_value_t.

int mmdeploy_classifier_apply_async(mmdeploy_classifier_t classifier, mmdeploy_sender_t input, mmdeploy_sender_t *output)

Apply classifier asynchronously.

Parameters
  • classifier[in] handle of the classifier

  • input[in] input sender that will be consumed by the operation

  • output[out] output sender

Returns

status of the operation

int mmdeploy_classifier_get_result(mmdeploy_value_t output, mmdeploy_classification_t **results, int **result_count)
Parameters
Returns

status of the operation

Read the Docs v: stable
Versions
latest
stable
1.x
v1.3.1
v1.3.0
v1.2.0
v1.1.0
v1.0.0
0.x
v0.14.0
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.