测出来的时间为:
解决方法为:
struct timeval tpstart,tpend;
float timeuse;
gettimeofday(&tpstart,NULL);
int index = HST_ClerkDetect(handle, img.data, img.cols, img.rows);//目标分类
gettimeofday(&tpend,NULL);
timeuse=1000000*(tpend.tv_sec-tpstart.tv_sec)+ tpend.tv_usec-tpstart.tv_usec;
timeuse/=1000000;
printf("HST_ClerkDetect: time cost %f s\n",timeuse);
头文件用这个#include <sys/time.h>
现在的时间为:
caffe 自带的测速:
这个是最准确的 但是因为检测到之后还需要一些处理 所以时间比forward 的时间长4ms 是正常的。
暂时理解到这个层次

本文介绍了一种使用Caffe进行目标检测的速度测量方法,并详细解释了如何通过代码获取精确的运行时间,包括前后处理时间的影响。
468

被折叠的 条评论
为什么被折叠?



