Shortcuts

detector.h

struct mmdeploy_instance_mask_t

Public Members

char *data
int height
int width
struct mmdeploy_detection_t

Public Members

int label_id
float score
mmdeploy_rect_t bbox
mmdeploy_instance_mask_t *mask
typedef struct mmdeploy_detector *mmdeploy_detector_t
int mmdeploy_detector_create(mmdeploy_model_t model, const char *device_name, int device_id, mmdeploy_detector_t *detector)

Create detector’s handle.

参数
  • model[in] an instance of mmdetection 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.

  • detector[out] instance of a detector

返回

status of creating detector’s handle

int mmdeploy_detector_create_by_path(const char *model_path, const char *device_name, int device_id, mmdeploy_detector_t *detector)

Create detector’s handle.

参数
  • model_path[in] path of mmdetection sdk model exported by mmdeploy model converter

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

  • device_id[in] id of device.

  • detector[out] instance of a detector

返回

status of creating detector’s handle

int mmdeploy_detector_apply(mmdeploy_detector_t detector, const mmdeploy_mat_t *mats, int mat_count, mmdeploy_detection_t **results, int **result_count)

Apply detector to batch images and get their inference results.

参数
返回

status of inference

void mmdeploy_detector_release_result(mmdeploy_detection_t *results, const int *result_count, int count)

Release the inference result buffer created by mmdeploy_detector_apply.

参数
  • results[in] detection results buffer

  • result_count[in] results size buffer

  • count[in] length of result_count

void mmdeploy_detector_destroy(mmdeploy_detector_t detector)

Destroy detector’s handle.

参数

detector[in] detector’s handle created by mmdeploy_detector_create_by_path

int mmdeploy_detector_create_v2(mmdeploy_model_t model, mmdeploy_context_t context, mmdeploy_detector_t *detector)

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

int mmdeploy_detector_create_input(const mmdeploy_mat_t *mats, int mat_count, mmdeploy_value_t *input)

Pack detector inputs into mmdeploy_value_t.

参数
  • mats[in] a batch of images

  • mat_count[in] number of images in the batch

返回

the created value

int mmdeploy_detector_apply_v2(mmdeploy_detector_t detector, mmdeploy_value_t input, mmdeploy_value_t *output)

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

int mmdeploy_detector_apply_async(mmdeploy_detector_t detector, mmdeploy_sender_t input, mmdeploy_sender_t *output)

Apply detector asynchronously.

参数
  • detector[in] handle to the detector

  • input[in] input sender

返回

output sender

int mmdeploy_detector_get_result(mmdeploy_value_t output, mmdeploy_detection_t **results, int **result_count)

Unpack detector output from a mmdeploy_value_t.

参数
  • output[in] output obtained by applying a detector

  • results[out] a linear buffer to save detection results of each image. It must be released by mmdeploy_detector_release_result

  • result_count[out] a linear buffer with length number of input images to save the number of detection results of each image. Must be released by mmdeploy_detector_release_result

返回

status of the operation

Read the Docs v: latest
Versions
latest
stable
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.