Shortcuts

segmentor.h

struct mmdeploy_segmentation_t

Public Members

int height

height of mask that equals to the input image’s height

int width

width of mask that equals to the input image’s width

int classes

the number of labels in mask

int *mask

segmentation mask of the input image, in which mask[i * width + j] indicates the label id of pixel at (i, j), this field might be null

float *score

segmentation score map of the input image in CHW format, in which score[height * width * k + i * width + j] indicates the score of class k at pixel (i, j), this field might be null

typedef struct mmdeploy_segmentor *mmdeploy_segmentor_t
int mmdeploy_segmentor_create(mmdeploy_model_t model, const char *device_name, int device_id, mmdeploy_segmentor_t *segmentor)

Create segmentor’s handle.

参数
返回

status of creating segmentor’s handle

int mmdeploy_segmentor_create_by_path(const char *model_path, const char *device_name, int device_id, mmdeploy_segmentor_t *segmentor)

Create segmentor’s handle.

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

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

  • device_id[in] id of device.

  • segmentor[out] instance of a segmentor, which must be destroyed by mmdeploy_segmentor_destroy

返回

status of creating segmentor’s handle

int mmdeploy_segmentor_apply(mmdeploy_segmentor_t segmentor, const mmdeploy_mat_t *mats, int mat_count, mmdeploy_segmentation_t **results)

Apply segmentor to batch images and get their inference results.

参数
返回

status of inference

void mmdeploy_segmentor_release_result(mmdeploy_segmentation_t *results, int count)

Release result buffer returned by mmdeploy_segmentor_apply.

参数
  • results[in] result buffer

  • count[in] length of results

void mmdeploy_segmentor_destroy(mmdeploy_segmentor_t segmentor)

Destroy segmentor’s handle.

参数

segmentor[in] segmentor’s handle created by mmdeploy_segmentor_create_by_path

int mmdeploy_segmentor_create_v2(mmdeploy_model_t model, mmdeploy_context_t context, mmdeploy_segmentor_t *segmentor)
int mmdeploy_segmentor_create_input(const mmdeploy_mat_t *mats, int mat_count, mmdeploy_value_t *value)
int mmdeploy_segmentor_apply_v2(mmdeploy_segmentor_t segmentor, mmdeploy_value_t input, mmdeploy_value_t *output)
int mmdeploy_segmentor_apply_async(mmdeploy_segmentor_t segmentor, mmdeploy_sender_t input, mmdeploy_sender_t *output)
int mmdeploy_segmentor_get_result(mmdeploy_value_t output, mmdeploy_segmentation_t **results)
Read the Docs v: stable
Versions
latest
stable
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.