|
28 | 28 | #include "ax_sys_api.h"
|
29 | 29 | #include "joint.h"
|
30 | 30 | #include "joint_adv.h"
|
31 |
| -#include "npu_cv_kit/npu_common.h" |
32 | 31 |
|
33 | 32 | namespace middleware
|
34 | 33 | {
|
@@ -211,59 +210,6 @@ namespace middleware
|
211 | 210 | return pBuf;
|
212 | 211 | }
|
213 | 212 |
|
214 |
| - AX_S32 prepare_io_npu_cv_image(AX_NPU_CV_Image* cv_image, AX_JOINT_IO_T& io, const AX_JOINT_IO_INFO_T* io_info, const uint32_t& batch = 1) |
215 |
| - { |
216 |
| - std::memset(&io, 0, sizeof(io)); |
217 |
| - |
218 |
| - io.nInputSize = io_info->nInputSize; |
219 |
| - if (1 != io.nInputSize) |
220 |
| - { |
221 |
| - fprintf(stderr, "[ERR]: Only single input was accepted(got %u).\n", io.nInputSize); |
222 |
| - return -1; |
223 |
| - } |
224 |
| - io.pInputs = new AX_JOINT_IO_BUFFER_T[io.nInputSize]; |
225 |
| - |
226 |
| - // fill input |
227 |
| - { |
228 |
| - const AX_JOINT_IOMETA_T* pMeta = io_info->pInputs; |
229 |
| - AX_JOINT_IO_BUFFER_T* pBuf = io.pInputs; |
230 |
| - |
231 |
| - if (pMeta->nShapeSize <= 0) |
232 |
| - { |
233 |
| - fprintf(stderr, "[ERR]: Dimension(%u) of shape is not allowed.\n", (uint32_t)pMeta->nShapeSize); |
234 |
| - return -1; |
235 |
| - } |
236 |
| - |
237 |
| - auto actual_data_size = pMeta->nSize / pMeta->pShape[0] * batch; |
238 |
| - if (cv_image->nSize != actual_data_size) |
239 |
| - { |
240 |
| - fprintf(stderr, |
241 |
| - "[ERR]: The cv_image size is not equal to model input(%s) size(%u vs %u).\n", |
242 |
| - io_info->pInputs[0].pName, |
243 |
| - (uint32_t)cv_image->nSize, |
244 |
| - actual_data_size); |
245 |
| - return -1; |
246 |
| - } |
247 |
| - |
248 |
| - pBuf->pVirAddr = cv_image->pVir; |
249 |
| - pBuf->phyAddr = cv_image->pPhy; |
250 |
| - pBuf->nSize = cv_image->nSize; |
251 |
| - } |
252 |
| - |
253 |
| - // deal with output |
254 |
| - { |
255 |
| - io.nOutputSize = io_info->nOutputSize; |
256 |
| - io.pOutputs = new AX_JOINT_IO_BUFFER_T[io.nOutputSize]; |
257 |
| - for (size_t i = 0; i < io.nOutputSize; ++i) |
258 |
| - { |
259 |
| - const AX_JOINT_IOMETA_T* pMeta = io_info->pOutputs + i; |
260 |
| - AX_JOINT_IO_BUFFER_T* pBuf = io.pOutputs + i; |
261 |
| - alloc_joint_buffer(pMeta, pBuf); |
262 |
| - } |
263 |
| - } |
264 |
| - return AX_ERR_NPU_JOINT_SUCCESS; |
265 |
| - } |
266 |
| - |
267 | 213 | AX_S32 prepare_io_out_cache(const void* buf, const size_t& size, AX_JOINT_IO_T& io, const AX_JOINT_IO_INFO_T* io_info, const uint32_t& batch = 1)
|
268 | 214 | {
|
269 | 215 | std::memset(&io, 0, sizeof(io));
|
|
0 commit comments