bnolan / echt-client

👀 React native component of the worlds greatest photo sharing app
1 stars 0 forks source link

Upload smaller photos for face recognition, then larger photos in background #32

Closed chillu closed 7 years ago

chillu commented 7 years ago

The onboarding experience is currently a bit rocky because the user has to wait for a full resolution photo to upload to the service. Technically AWS Rekognition only needs ~100px of face data, so could make do with a much smaller version to complete signup.

We're asking RNCamera for "high" quality, without JPEG compression (see options) - so will get you a 3000px image weighing around 1.5MB by default. I think we should upload the larger version in the background. We can't just keep it locally on the device because other users can see these photos in their stream, and likely want the full version.

Note: The simulator uploads currently resize to 1024, so the problem isn't as apparent there.

chillu commented 7 years ago

From AWS FAQ:

Q: How does image resolution affect the quality of results?

Amazon Rekognition works across a wide range of image resolutions. For best results we recommend using VGA (640x480) resolution or higher. Going below QVGA (320x240) may increase the chances of missing faces, objects, or inappropriate content; although Amazon Rekognition accepts images that are at least 80 pixels in both dimensions.

Q. How small can an object be for Amazon Rekognition to detect and analyze it?

As a rule of thumb, please ensure that the smallest object or face present in the image is at least 5% of the size (in pixels) of the shorter image dimension. For example, if you are working with a 1600x900 image, the smallest face or object should be at least 45 pixels in either dimension.

chillu commented 7 years ago

Ph look, done this a while ago: https://github.com/bnolan/echt-client/commit/5c6351a36f9defefdb488ccbc3cc590068100fd6