aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/main.c b/main.c
index af311bd..bf56603 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-#include "yunet.h"
+#include "facedet.h"
#include "image.h"
#include "overlay.h"
@@ -168,14 +168,14 @@ int main(int argc, char **argv) {
return 1;
}
int iw = (width + 31) & ~31, ih = (height + 31) & ~31;
- yunet *m = yunet_create(iw, ih);
- int rc = m ? yunet_set_rgb(m, rgb, width, height, (size_t)width * 3) : -1;
+ facedet *m = facedet_create(iw, ih);
+ int rc = m ? facedet_set_rgb(m, rgb, width, height, (size_t)width * 3) : -1;
if (rc == 0)
- rc = yunet_run(m);
+ rc = facedet_run(m);
int cap = 21 * (iw / 32) * (ih / 32);
- yunet_detection *faces = rc == 0 ? malloc((size_t)cap * sizeof(*faces)) : NULL;
- int n = faces ? yunet_decode(m, score, nms, faces, cap) : -1;
- yunet_free(m);
+ facedet_detection *faces = rc == 0 ? malloc((size_t)cap * sizeof(*faces)) : NULL;
+ int n = faces ? facedet_decode(m, score, nms, faces, cap) : -1;
+ facedet_free(m);
if (n < 0) {
fprintf(stderr, "Inference failed; memory allocation or input validation failed.\n");
free(faces);
@@ -183,9 +183,9 @@ int main(int argc, char **argv) {
return 1;
}
if (refine) {
- yunet *refiner = yunet_create_refiner();
- rc = refiner ? yunet_refine(refiner, rgb, width, height, (size_t)width * 3, faces, n) : -1;
- yunet_free(refiner);
+ facedet *refiner = facedet_create_refiner();
+ rc = refiner ? facedet_refine(refiner, rgb, width, height, (size_t)width * 3, faces, n) : -1;
+ facedet_free(refiner);
if (rc) {
fputs("Landmark refinement failed; check embedded weights and available memory.\n", stderr);
free(faces);
@@ -203,7 +203,7 @@ int main(int argc, char **argv) {
printf("{\"width\":%d,\"height\":%d,\"input_width\":%d,\"input_height\":%d,\"faces\":[",
width, height, iw, ih);
for (int i = 0; i < n; i++) {
- const yunet_detection *d = &faces[i];
+ const facedet_detection *d = &faces[i];
printf("%s{\"box\":[%.7g,%.7g,%.7g,%.7g],\"score\":%.7g,\"landmarks\":[",
i ? "," : "", d->x, d->y, d->w, d->h, d->score);
for (int k = 0; k < 5; k++)