shubham0204 / FaceRecognition_With_FaceNet_Android

Face Recognition using the FaceNet model and MLKit on Android.
https://towardsdatascience.com/using-facenet-for-on-device-face-recognition-with-android-f84e36e19761
Apache License 2.0
252 stars 88 forks source link

[Error] : Getting facelist.size as 0 in FrameAnalyser.kt #16

Closed gowthami77 closed 3 years ago

gowthami77 commented 3 years ago

Hi, i am getting facelist.size is ''0'' . may i know why this is coming. After that one i am getting this log I/Model: Average score for each user : {}
and then it is going into cache the error in cache was

E/Model: Exception in FrameAnalyser : null

Can you explain why this is going to cache and what i have to do to work the sample properly.

I am using using your latest code. once the app is launched it cannot show the bounding box over the face.

Please solve my issue as possible as fast.

venkakat83 commented 3 years ago

Hi Gowtthami,

Make the following variable to true

private val cropWithBBoxes : Boolean = true

gowthami77 commented 3 years ago

hi @venkakat83 i was chaged that variable to true. But there is no change in that.

shubham0204 commented 3 years ago

@gowthami77, have you enabled the storage permission for the app? Is the file structure ( of your images ), the same as described in the README?

gowthami77 commented 3 years ago

@venkakat83 i have enabled the storage permissions and i created two folders in images directory in that i stored two images in each directory as shown in README.

venkakat83 commented 3 years ago

Hi Gowthami,

Can you paste the location where you have saved the files? Ideally it should be in externalStorageDirectory.

Note:- (From API Level 30 this storage gets deprecated)

gowthami77 commented 3 years ago

Phone Storage/images/rahul/rahul_1.jpg

venkakat83 commented 3 years ago

Try to store at /storage/emulated/0/images/PERSONNAME,

If you can access android device directly, On Android devices 1) Go to files 2) Internal Storage 3) Create Images directory (if it doesn't exists) 4) Create PersonName directory 5) Place the .jpg images of good resolution.

gowthami77 commented 3 years ago

i also stored in internal storage only

venkakat83 commented 3 years ago

Try to keep the following log and check if you are saving at same location.

Log.i( "Location" , "LocationDirectory ${Environment.getExternalStorageDirectory().absolutePath}" )

If the issue still persists, then the issue will be something else.

gowthami77 commented 3 years ago

I am getting the same path. but unable get boundaries to the face

gowthami77 commented 3 years ago

Is there any solution? for this

gowthami77 commented 3 years ago

i got the solution for this one added

    android:requestLegacyExternalStorage="true"

in android manifest