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 /nn.c | |
| parent | 2ce585cc96a3fffba65f1bafbfbc796c6370308f (diff) | |
| download | facedet-0.1.0.tar.gz facedet-0.1.0.zip | |
Diffstat (limited to 'nn.c')
| -rw-r--r-- | nn.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -4,7 +4,7 @@ #include <math.h> #include <string.h> -void yunet_nn_conv2d(const float *x, +void facedet_nn_conv2d(const float *x, int cin, int ih, int iw, @@ -53,7 +53,7 @@ void yunet_nn_conv2d(const float *x, } } -void yunet_nn_im2col3(const float *x, int cin, int ih, int iw, int stride, float *col, int oh, int ow) { +void facedet_nn_im2col3(const float *x, int cin, int ih, int iw, int stride, float *col, int oh, int ow) { size_t n = (size_t)oh * ow; for (int ic = 0; ic < cin; ic++) { const float *xc = x + (size_t)ic * ih * iw; @@ -93,9 +93,9 @@ void yunet_nn_im2col3(const float *x, int cin, int ih, int iw, int stride, float } } -#if defined(__aarch64__) && !defined(YUNET_SCALAR) +#if defined(__aarch64__) && !defined(FACEDET_SCALAR) # include <arm_neon.h> -void yunet_nn_dwconv3( +void facedet_nn_dwconv3( const float *x, int c, int ih, int iw, const float *w, const float *bias, int relu, float *y) { for (int ch = 0; ch < c; ch++) { const float *xc = x + (size_t)ch * ih * iw; @@ -163,13 +163,13 @@ void yunet_nn_dwconv3( } } #else -void yunet_nn_dwconv3( +void facedet_nn_dwconv3( const float *x, int c, int ih, int iw, const float *w, const float *bias, int relu, float *y) { - yunet_nn_conv2d(x, c, ih, iw, w, bias, c, 3, 1, 1, c, relu, y, ih, iw); + facedet_nn_conv2d(x, c, ih, iw, w, bias, c, 3, 1, 1, c, relu, y, ih, iw); } #endif -void yunet_nn_maxpool2(const float *x, int c, int ih, int iw, float *y) { +void facedet_nn_maxpool2(const float *x, int c, int ih, int iw, float *y) { int oh = ih / 2, ow = iw / 2; for (int ch = 0; ch < c; ch++) { const float *xc = x + (size_t)ch * ih * iw; @@ -184,7 +184,7 @@ void yunet_nn_maxpool2(const float *x, int c, int ih, int iw, float *y) { } } -void yunet_nn_resize2x(const float *x, int c, int ih, int iw, float *y) { +void facedet_nn_resize2x(const float *x, int c, int ih, int iw, float *y) { int oh = ih * 2, ow = iw * 2; for (int ch = 0; ch < c; ch++) { const float *xc = x + (size_t)ch * ih * iw; @@ -198,9 +198,9 @@ void yunet_nn_resize2x(const float *x, int c, int ih, int iw, float *y) { } } -void yunet_nn_add(const float *a, const float *b, float *y, size_t n) { +void facedet_nn_add(const float *a, const float *b, float *y, size_t n) { for (size_t i = 0; i < n; i++) y[i] = a[i] + b[i]; } -float yunet_nn_sigmoid(float v) { return 1.0f / (1.0f + expf(-v)); } +float facedet_nn_sigmoid(float v) { return 1.0f / (1.0f + expf(-v)); } |
