Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Liveness - FaceLivenessDetector component to support Theme Object and Color Mode #5103

Open
1 of 2 tasks
lwin-kyaw opened this issue Mar 26, 2024 · 1 comment
Open
1 of 2 tasks
Labels
feature-request Request a new feature Liveness

Comments

@lwin-kyaw
Copy link

On which framework/platform would you like to see this feature implemented?

React

Which UI component is this feature-request for?

Liveness

Please describe your feature-request in detail.

Hi, FaceLivenessDectector component does not follow the colors from ThemeObject and ColorMode.

Affected Version:

  • 3.0.13/14/15 (versions I have tried)
  • examples from amplify-ui repo

Example Code

const theme: Theme = {
  name: 'liveness-theme',
  overrides: [defaultDarkModeOverride],
};
...
return (
  <ThemeProvider theme={theme} colorMode="dark">
    <FaceLivenessDetectorCore ... />
  </ThemeProvider>
);

Expected Result

Screenshot 2024-03-26 at 13 06 13

Actual Result

Screenshot 2024-03-26 at 13 05 22

Please describe a solution you'd like.

I have noticed that liveness oval canvas fillStyle has been hard-coded and set to white color (#fff) during detectInitialFaceAndDrawOval.

// packages/react-liveness/src/components/FaceLivenessDetector/service/utils/liveness.ts
ctx.fillStyle = isStartScreen
  ? getComputedStyle(canvas).getPropertyValue(
      '--amplify-colors-background-primary'
    )
  : '#fff';
ctx.fillRect(0, 0, canvasWidth, canvasHeight);

Tbh, I don't have enough knowledge on image recognition subject so I am not really whether it was by design or not.
If it's not by design, it would be nice if users could modify the canvas fillStyle via ThemeObject so that it will align with the App theme.

We love contributors! Is this something you'd be interested in working on?

  • 👋 I may be able to implement this feature request.
  • ⚠️ This feature might incur a breaking change.
@lwin-kyaw lwin-kyaw added the feature-request Request a new feature label Mar 26, 2024
@github-actions github-actions bot added the pending-triage Issue is pending triage label Mar 26, 2024
@reesscot
Copy link
Contributor

@lwin-kyaw The hardcoded background color is required by the ML model to get enough light on the user's face to effectively do the Liveness check. We are considering adding the ability to customize more of the theme to our roadmap.

@reesscot reesscot changed the title FaceLivenessDector component to follow Theme Object and Color Mode [FR] Liveness - FaceLivenessDetector component to support Theme Object and Color Mode Mar 26, 2024
@reesscot reesscot added Liveness and removed pending-triage Issue is pending triage labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature Liveness
Projects
None yet
Development

No branches or pull requests

2 participants