mxnet-insightface-cpp icon indicating copy to clipboard operation
mxnet-insightface-cpp copied to clipboard

GPU : is this code running on the Gpu also ?

Open MyraBaba opened this issue 6 years ago • 1 comments

Hi @njvisionpower

I have gpu compiled mxnet. can I run this code on the gpu ? do I need changes ?

MyraBaba avatar Jan 12 '20 21:01 MyraBaba

@njvisionpower

do you think below code is runs faster in GPU if the db is huge ?


`class_info classify(const cv::Mat& img, const  cv::Mat& cmp)
{
	int rows = cmp.rows;
	cv::Mat broad;
	cv::repeat(img, rows, 1, broad);

	broad = broad - cmp;
	cv::pow(broad,2,broad);
	cv::reduce(broad, broad, 1, cv::REDUCE_SUM);

	double dis;
	cv::Point point;
	cv::minMaxLoc(broad, &dis, 0, &point, 0);

	return class_info{dis, point.y};
}`

MyraBaba avatar Jul 14 '20 10:07 MyraBaba