From b7e0f4cc5d5eef69ba668eefa67b46504570b7ba Mon Sep 17 00:00:00 2001 From: xuepengqiang <506321815@qq.com> Date: 星期四, 09 一月 2020 09:48:21 +0800 Subject: [PATCH] uptate utils --- reid_utils.cpp | 41 ----------------------------------------- 1 files changed, 0 insertions(+), 41 deletions(-) diff --git a/reid_utils.cpp b/reid_utils.cpp index 4208152..17927ba 100644 --- a/reid_utils.cpp +++ b/reid_utils.cpp @@ -4,47 +4,6 @@ #include "reid_utils.h" -//import torch -// -//a=torch.Tensor([[1,2,3],[4,5,6]]) -//b=torch.Tensor([[7,8,9],[10,11,12]]) -//d=torch.stack( (a,b) ,dim = 1) -// -//print(d) - -//template<typename T> -//unsigned char * ReID_Utils::T2bytes(T u) -//{ -// int n = sizeof(T); -// unsigned char* b = new unsigned char[n]; -// memcpy(b, &u, n); -// return b; -//} -// -//template<typename T> -//T ReID_Utils::bytes2T(unsigned char *bytes) -//{ -// T res = 0; -// int n = sizeof(T); -// memcpy(&res, bytes, n); -// return res; -//} - -unsigned char * ReID_Utils::T2bytes(float u) -{ - int n = sizeof(u); - unsigned char* b = new unsigned char[n]; - memcpy(b, &u, n); - return b; -} - -float ReID_Utils::bytes2T(unsigned char *bytes) -{ - float res = 0; - int n = sizeof(res); - memcpy(&res, bytes, n); - return res; -} void *ReID_Utils::normalize(unsigned char *vsrc, int w, int h, int chan){ float *data = (float*)malloc(h*w*chan*sizeof(float)); -- Gitblit v1.8.0