diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-10-21 17:47:57 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-10-21 17:47:57 +0200 |
| commit | 8b8acffcf5f1e9e9ddb552b8ac125e50f68987ac (patch) | |
| tree | 9b618133a468585087ff4b014b22029d40b24bc5 /facedet.h | |
| parent | 2ce585cc96a3fffba65f1bafbfbc796c6370308f (diff) | |
| download | facedet-master.tar.gz facedet-master.zip | |
Diffstat (limited to '')
| -rw-r--r-- | facedet.h (renamed from yunet.h) | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -1,55 +1,55 @@ -#ifndef YUNET_H -#define YUNET_H +#ifndef FACEDET_H +#define FACEDET_H #include <stddef.h> -typedef struct yunet yunet; +typedef struct facedet facedet; typedef struct { float x, y, w, h; float lmk[5][2]; float score; -} yunet_detection; +} facedet_detection; /* Each dimension must be a multiple of 32 between 32 and 4096. * A context owns mutable scratch space and is not safe for concurrent calls. */ -yunet *yunet_create(int width, int height); -void yunet_free(yunet *m); +facedet *facedet_create(int width, int height); +void facedet_free(facedet *m); /* The input is float32 BGR in CHW order, with values in [0, 255]. * The returned buffer belongs to the context. */ -float *yunet_input(yunet *m); +float *facedet_input(facedet *m); /* Interleaved RGB8 is converted to BGR CHW without resizing. The right and * bottom padding are zero. Width and height cannot exceed the context size. * The RGB buffer must contain at least (height-1)*row_bytes + width*3 bytes. */ -int yunet_set_rgb(yunet *m, const unsigned char *rgb, int width, int height, size_t row_bytes); -int yunet_run(yunet *m); +int facedet_set_rgb(facedet *m, const unsigned char *rgb, int width, int height, size_t row_bytes); +int facedet_run(facedet *m); /* Names are cls_s, obj_s, bbox_s, kps_s, with s in {8,16,32}. * Maps use CHW order; cls and obj contain logits, not probabilities. * The buffer belongs to the context and is valid until the next input change * or run. NULL means that no result or no matching map is available. */ -const float *yunet_map(const yunet *m, const char *name, int *channels, int *height, int *width); +const float *facedet_map(const facedet *m, const char *name, int *channels, int *height, int *width); /* Detector contexts only. Returns the number of detections, or -1 for * invalid arguments/no result. Results are sorted by score after greedy NMS, in input pixel coordinates, * without clipping. Landmarks: right eye, left eye, nose, right/left mouth. * cap limits returned detections, not candidates considered before sorting. */ -int yunet_decode(const yunet *m, float score_threshold, float nms_iou, - yunet_detection *out, int cap); +int facedet_decode(const facedet *m, float score_threshold, float nms_iou, + facedet_detection *out, int cap); /* Returns NULL if optional refinement weights are unavailable or allocation * fails. This context has a fixed 160x160 BGR input for landmark refinement. */ -yunet *yunet_create_refiner(void); +facedet *facedet_create_refiner(void); /* Replaces landmarks only; boxes, scores, and ordering remain unchanged. * Each box defines a centered square crop with side 1.3*max(width,height). * Bilinear sampling uses pixel centers and zero outside the RGB image. - * RGB dimensions are 1..4096; buffer/stride requirements match yunet_set_rgb. + * RGB dimensions are 1..4096; buffer/stride requirements match facedet_set_rgb. * Returns 0 on success, -1 on error. All detections remain unchanged on error. - * m must be a context returned by yunet_create_refiner. */ -int yunet_refine(yunet *m, const unsigned char *rgb, int width, int height, - size_t row_bytes, yunet_detection *faces, int count); + * m must be a context returned by facedet_create_refiner. */ +int facedet_refine(facedet *m, const unsigned char *rgb, int width, int height, + size_t row_bytes, facedet_detection *faces, int count); #endif |
