Git Product home page Git Product logo

Comments (9)

emreakcan avatar emreakcan commented on July 23, 2024

if I run the L2Norm with the FloatArrays that I get from the Xiaomi, Samsung can do the calculation correctly.

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 23, 2024

This is because of different device configurations. Probably switching off the GpuDelegate and XNNPack might help.
In the FaceNetModel.kt class, you'll see these lines,

init {
    // Initialize TFLiteInterpreter
    val interpreterOptions = Interpreter.Options().apply {
        // Add the GPU Delegate if supported.
        // See -> https://www.tensorflow.org/lite/performance/gpu#android
        if ( CompatibilityList().isDelegateSupportedOnThisDevice ) {
            addDelegate( GpuDelegate( CompatibilityList().bestOptionsForThisDevice ))
        }
        else {
            // Number of threads for computation
            setNumThreads( 4 )
        }
        setUseXNNPACK( true )
    }
    interpreter = Interpreter(FileUtil.loadMappedFile(context, model.assetsFilename ) , interpreterOptions )
    Logger.log("Using ${model.name} model.")
}

Replace these lines with,

init {
    // Initialize TFLiteInterpreter
    val interpreterOptions = Interpreter.Options().apply {    
         setNumThreads( 4 )
    }
    interpreter = Interpreter(FileUtil.loadMappedFile(context, model.assetsFilename ) , interpreterOptions )
    Logger.log("Using ${model.name} model.")
}

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 23, 2024

@emreakcan Could you resolve the error by removing GpuDelegate?

from facerecognition_with_facenet_android.

DineshIT avatar DineshIT commented on July 23, 2024

HI @shubham0204,

I'm also facing the same issue with face recognition. Initially, it generated multiple results for the same face. But now after removing the GPUDelegate and XNNPack, for all the faces it is giving me the same result as unknown.

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 23, 2024

@DineshIT can you send me some more details of the Samsung A21 device on which you're testing the app? I need these details specifically:

  1. Android OS Version
  2. GPU Renderer
  3. Supported ABIs
  4. CPU architecture

You can get these details by installing the Device Info app on the device.

from facerecognition_with_facenet_android.

DineshIT avatar DineshIT commented on July 23, 2024

from facerecognition_with_facenet_android.

DineshIT avatar DineshIT commented on July 23, 2024

Hi @shubham0204

I have worked on this issue and fixed it by adding the properties in the interpreter class object.

Please check my commit in the repo and merge it to handle this issue.

Hi @emreakcan

You can make the mentioned changes in your FaceNetModel Class and verify whether this issue got fixed at your end. If you got success please share with us.

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 23, 2024

@DineshIT Can you open a PR in this repo, so that I can review the changes?

from facerecognition_with_facenet_android.

DineshIT avatar DineshIT commented on July 23, 2024

PR has been created

from facerecognition_with_facenet_android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.