-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: server crash when model is none * feat: yolo v8 pose for hailo (experimental) * fix: compile errors * chore: cleanup, bug fixes
- Loading branch information
Showing
16 changed files
with
664 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
|
||
#include "ma_math_scalars.h" | ||
#include "ma_math_vectors.h" | ||
#include "ma_math_matrix.h" | ||
|
||
#endif // _MA_MATH_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "ma_math_matrix.h" | ||
#include "ma_math_vectors.h" | ||
|
||
#include <cmath> | ||
|
||
namespace ma::math { | ||
|
||
void softmax2D(float* data, size_t rows, size_t cols) { | ||
size_t size = rows * cols; | ||
for (size_t i = 0; i < size; i += cols) { | ||
softmax(&data[i], cols); | ||
} | ||
} | ||
|
||
void fastSoftmax2D(float* data, size_t rows, size_t cols) { | ||
size_t size = rows * cols; | ||
for (size_t i = 0; i < size; i += cols) { | ||
fastSoftmax(&data[i], cols); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef _MA_MATH_MARTRIX_H_ | ||
#define _MA_MATH_MARTRIX_H_ | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
|
||
#if MA_USE_LIB_XTENSOR | ||
#include <xtensor/xarray.hpp> | ||
#include <xtensor/xmath.hpp> | ||
#include <xtensor/xview.hpp> | ||
#endif | ||
|
||
namespace ma::math { | ||
|
||
void softmax2D(float* data, size_t rows, size_t cols); | ||
|
||
void fastSoftmax2D(float* data, size_t rows, size_t cols); | ||
|
||
#if MA_USE_LIB_XTENSOR | ||
template <typename QT> | ||
static void dequantizeValues2D(xt::xarray<float>& dequantized_outputs, int index, const xt::xarray<QT>& quantized_outputs, size_t dim1, size_t dim2, float32_t qp_scale, float32_t qp_zp) { | ||
for (size_t i = 0; i < dim1; i++) { | ||
for (size_t j = 0; j < dim2; j++) { | ||
dequantized_outputs(i, j) = (float(quantized_outputs(index, i, j)) - qp_zp) * qp_scale; | ||
} | ||
} | ||
} | ||
#endif | ||
|
||
} // namespace ma::math | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.