deepcam-cn / Face-Anti-spoofing.pytorch

Train code of face anti-spoofing with a single RGB frame

Home Page:https://deepcam.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The so files question

KevinAnnn opened this issue · comments

commented

Hello up , can you publish the so source code? Now I don't know how to implement data processing.

It's very convenient to do data processing with MNN after getting the face image Mat:

const float mean_vals[3] = { 123.675f, 116.28f, 103.53f };
const float norm_vals[3] = { 0.0171247538f, 0.0175070028f, 0.0174291939f };
...
                ::memcpy(img_config.mean, mean_vals, sizeof(mean_vals));
		::memcpy(img_config.normal, norm_vals, sizeof(norm_vals));
		img_config.sourceFormat = (MNN::CV::ImageFormat)2;
		img_config.destFormat = (MNN::CV::ImageFormat)1;
		img_config.filterType = (MNN::CV::Filter)(1);
		img_config.wrap = (MNN::CV::Wrap)(1);
...
	//prepare data
	std::shared_ptr<MNN::CV::ImageProcess> pretreat(MNN::CV::ImageProcess::create(img_config));
	pretreat->convert(img.data, 128, 128, img.step[0], input_tensor);
commented

It's very convenient to do data processing with MNN after getting the face image Mat:

const float mean_vals[3] = { 123.675f, 116.28f, 103.53f };
const float norm_vals[3] = { 0.0171247538f, 0.0175070028f, 0.0174291939f };
...
                ::memcpy(img_config.mean, mean_vals, sizeof(mean_vals));
		::memcpy(img_config.normal, norm_vals, sizeof(norm_vals));
		img_config.sourceFormat = (MNN::CV::ImageFormat)2;
		img_config.destFormat = (MNN::CV::ImageFormat)1;
		img_config.filterType = (MNN::CV::Filter)(1);
		img_config.wrap = (MNN::CV::Wrap)(1);
...
	//prepare data
	std::shared_ptr<MNN::CV::ImageProcess> pretreat(MNN::CV::ImageProcess::create(img_config));
	pretreat->convert(img.data, 128, 128, img.step[0], input_tensor);

Thank you very much.