Commit 4a5239db authored by Rob Schonberger's avatar Rob Schonberger Committed by Commit Bot

Update TF Native code of NN Palm Rejection.

Model desc:
1. Trained with Kohaku, Kohaku-Prev and Basking data. Combined AUC is 0.982
2. Feature Vector Unchanged
3. Model Radius changed in Kohaku for new fw.
4. Eval on held out Kohaku data is 0.988, held out basking 0.976.

Bug: 1095874
Test: Deployed and tested on a kohaku device.
Change-Id: Ia76a6c740dd7f85b8f64b87f0ff170a83196a8f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521880
Commit-Queue: Rob Schonberger <robsc@chromium.org>
Reviewed-by: default avatarXinglong Luan <alanlxl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825041}
parent 2a38f605
...@@ -69,7 +69,7 @@ std::string FetchNeuralPalmRadiusPolynomial(const EventDeviceInfo& devinfo, ...@@ -69,7 +69,7 @@ std::string FetchNeuralPalmRadiusPolynomial(const EventDeviceInfo& devinfo,
// TODO(robsc): Investigate a better way of doing this configuration. // TODO(robsc): Investigate a better way of doing this configuration.
std::string release_board = base::SysInfo::GetLsbReleaseBoard(); std::string release_board = base::SysInfo::GetLsbReleaseBoard();
if ("hatch" == release_board) { if ("hatch" == release_board) {
return "0.090477715, 3.9225964"; return "0.1010944, 3.51837568";
} else if ("reef" == release_board) { } else if ("reef" == release_board) {
return "0.17889799, 4.22584412"; return "0.17889799, 4.22584412";
} }
...@@ -91,10 +91,12 @@ std::unique_ptr<PalmDetectionFilter> CreatePalmDetectionFilter( ...@@ -91,10 +91,12 @@ std::unique_ptr<PalmDetectionFilter> CreatePalmDetectionFilter(
if (base::FeatureList::IsEnabled(kEnableNeuralPalmDetectionFilter) && if (base::FeatureList::IsEnabled(kEnableNeuralPalmDetectionFilter) &&
NeuralStylusPalmDetectionFilter:: NeuralStylusPalmDetectionFilter::
CompatibleWithNeuralStylusPalmDetectionFilter(devinfo)) { CompatibleWithNeuralStylusPalmDetectionFilter(devinfo)) {
std::vector<float> radius_polynomial = internal::ParseRadiusPolynomial( std::string polynomial_string = internal::FetchNeuralPalmRadiusPolynomial(
internal::FetchNeuralPalmRadiusPolynomial( devinfo, kNeuralPalmRadiusPolynomial.Get());
devinfo, kNeuralPalmRadiusPolynomial.Get())); VLOG(1) << "Will attempt to use radius polynomial: " << polynomial_string;
// Theres only one model right now. std::vector<float> radius_polynomial =
internal::ParseRadiusPolynomial(polynomial_string);
// There's only one model right now.
std::unique_ptr<NeuralStylusPalmDetectionFilterModel> model = std::unique_ptr<NeuralStylusPalmDetectionFilterModel> model =
std::make_unique<OneDeviceTrainNeuralStylusPalmDetectionFilterModel>( std::make_unique<OneDeviceTrainNeuralStylusPalmDetectionFilterModel>(
radius_polynomial); radius_polynomial);
......
...@@ -55,8 +55,8 @@ class PalmDetectionFilterFactoryDeathTest ...@@ -55,8 +55,8 @@ class PalmDetectionFilterFactoryDeathTest
TEST_F(PalmDetectionFilterFactoryTest, RadiusesFromLSBRelease) { TEST_F(PalmDetectionFilterFactoryTest, RadiusesFromLSBRelease) {
std::string lsb_release = "CHROMEOS_RELEASE_BOARD=hatch\n"; std::string lsb_release = "CHROMEOS_RELEASE_BOARD=hatch\n";
base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, base::Time()); base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, base::Time());
EXPECT_EQ("0.090477715, 3.9225964", internal::FetchNeuralPalmRadiusPolynomial( EXPECT_EQ("0.1010944, 3.51837568", internal::FetchNeuralPalmRadiusPolynomial(
kohaku_touchscreen_info_, "")); kohaku_touchscreen_info_, ""));
lsb_release = "CHROMEOS_RELEASE_BOARD=reef\n"; lsb_release = "CHROMEOS_RELEASE_BOARD=reef\n";
base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, base::Time()); base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, base::Time());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment