Skip to content

Latest commit

 

History

History
70 lines (43 loc) · 5.68 KB

README.md

File metadata and controls

70 lines (43 loc) · 5.68 KB

React Native Camera

A Fork of React Native Camera.

React Native Camera has add mlkit already. You can get face bounds, landmarks, classification, and face tracking of a face.

For more information https://firebase.google.com/docs/ml-kit/face-detection-concepts

But face contours detection remains to be implemented, so I implement this feature.

For Android

Android Add Contour detects for react-native-camera

contours detects are supports in sourceset mlkit

So, if you add this lib to your react native app, you should add missingDimensionStrategy 'react-native-camera', 'mlkit' to defaultConfig in build.gradle(app).

Change sourceset when developing

If you want to add another soruce, set new sourceset name in productFlavors and sourceSets

then change Active Build Variant in Build Variants on the bottom left of Android Studio.

Entry File

CameraModule under org.reactnative.camera package (Not Sure)

Main Flow

image

For iOS

I am newbee to iOS.

First install pods. brew install cocoapods

Then cd into ios folder and pod install

Then yarn run ios --simulator='iPhone SE (2nd generation)'

https://reactnative.dev/docs/native-modules-ios

A demo data

{"bounds": {"origin": {"x": 120.38095238095241, "y": 116.22261904761905}, "size": {"height": 488.7452380952381, "width": 278.0952380952381}}, "face": [{"x": 257.58170572916663, "y": 157.12039533342636}, {"x": 239.70775204613093, "y": 161.4703869047619}, {"x": 207.21554129464283, "y": 176.5245338076637}, {"x": 184.0712658110119, "y": 198.7934297107515}, {"x": 73.94287109375004, "y": 229.9989222935268}, {"x": 59.61332775297615, "y": 268.04805850074405}, {"x": 53.040550595238095, "y": 304.9838108607701}, {"x": 50.056896391369044, "y": 345.20760425385976}, {"x": 49.687709263392854, "y": 381.9032216389974}, {"x": 51.112723214285666, "y": 419.5704511369978}, {"x": 55.306384858630906, "y": 458.9723951067244}, {"x": 64.27643694196428, "y": 497.75649602980843}, {"x": 78.35193452380952, "y": 526.479815092541}, {"x": 187.0102074032738, "y": 540.0293599446615}, {"x": 203.58175223214283, "y": 553.647166515532}, {"x": 218.85114397321428, "y": 559.4707443963914}, {"x": 234.69161551339283, "y": 562.7914941696894}, {"x": 255.34342447916666, "y": 564.2091776529949}, {"x": 271.2073916480655, "y": 563.0950488862537}, {"x": 286.8441917782738, "y": 559.075293695359}, {"x": 306.39727492559524, "y": 551.4174191429502}, {"x": 320.72190057663687, "y": 543.0905391148159}, {"x": 334.1889532180059, "y": 532.9792381649926}, {"x": 347.87127976190476, "y": 515.5144638788132}, {"x": 359.4108421688988, "y": 498.49454200381325}, {"x": 369.1274007161458, "y": 469.29102071126306}, {"x": 373.99825613839283, "y": 427.70669948032923}, {"x": 375.23219517299106, "y": 387.6762804303851}, {"x": 374.60270182291663, "y": 350.1860031854539}, {"x": 371.72645205543154, "y": 314.61281026204426}, {"x": 367.1865059988839, "y": 276.3841484433129}, {"x": 360.43112909226187, "y": 241.86369614374073}, {"x": 346.8119187127976, "y": 206.90621308826266}, {"x": 330.27666945684524, "y": 180.40983101981027}, {"x": 307.49097842261904, "y": 163.73710937500002}, {"x": 275.23043387276783, "y": 157.10867978050595}], "faceID": 0, "lowerLipBottom": [{"x": 232.9501255580357, "y": 453.6093468075707}, {"x": 238.8967866443452, "y": 453.9246170770555}, {"x": 247.69973028273807, "y": 454.9573464529855}, {"x": 258.0649879092262, "y": 455.56374482654394}, {"x": 268.8172433035714, "y": 454.12442481631325}, {"x": 279.7986188616071, "y": 453.08631170363657}, {"x": 290.0628138950893, "y": 450.14022260393415}, {"x": 298.62450009300596, "y": 447.00340023949036}, {"x": 304.87476748511904, "y": 445.49541219075525}], "lowerLipTop": [{"x": 238.89015997023807, "y": 445.96467764718193}, {"x": 243.5877976190476, "y": 442.1767955961682}, {"x": 250.8291015625, "y": 437.3845926920573}, {"x": 259.37620907738096, "y": 434.8788526262556}, {"x": 268.42803664434524, "y": 433.3354808989026}, {"x": 277.6195359002976, "y": 432.9633935837519}, {"x": 286.07914806547615, "y": 433.9387980143229}, {"x": 293.30082775297615, "y": 436.88458237420946}, {"x": 298.22705078125, "y": 439.76014113653275}], "rollAngle": -0, "upperLipBottom": [{"x": 303.98485165550596, "y": 441.7695954822359}, {"x": 293.26356724330356, "y": 435.76551005045576}, {"x": 285.92769949776783, "y": 432.9641046433222}, {"x": 277.8094308035714, "y": 431.61671447753906}, {"x": 269.1005161830357, "y": 431.8807545979818}, {"x": 260.3809291294643, "y": 433.34814453125}, {"x": 251.87944103422618, "y": 436.4109489804223}, {"x": 244.46298363095238, "y": 440.90389738537016}, {"x": 233.6293247767857, "y": 449.4421991257441}], "upperLipTop": [{"x": 309.1796177455357, "y": 443.29302368164065}, {"x": 306.9833519345238, "y": 436.32694237118676}, {"x": 300.89918154761904, "y": 427.82317780994237}, {"x": 292.85788690476187, "y": 417.3514035179502}, {"x": 280.51371837797615, "y": 409.03691624232704}, {"x": 269.05662899925596, "y": 411.40332249232705}, {"x": 257.2259347098214, "y": 411.2897222609747}, {"x": 245.1215122767857, "y": 422.0384711855934}, {"x": 237.19677734375, "y": 434.2073415120443}, {"x": 231.26204427083331, "y": 444.45892435709635}, {"x": 228.85718936011904, "y": 452.14808553059896}], "yawAngle": 0}

Problem

{ "face": [{"x": ..., "y": ...}, ...], "lowerLipBottom": [Point...], "lowerLipTop": [{"x": ..., "y": ...}, ...], "upperLipBottom": [{"x": ..., "y": ...}, ...]}, "upperLipTop": [Point...], "rightEye": [Point...], "leftEye": [Point...], "leftEyebrowTop": [Point...], "rightEyebrowTop": [Point...], "leftEyebrowBottom": [Point...], "rightEyebrowBottom": [Point...], "noseBridge":[Point...], "noseBottom": [Point...], } Point: {"x": float, "y": float}