Git Product home page Git Product logo

Comments (6)

michealChin avatar michealChin commented on July 28, 2024 1

@michealChin There is no such specification on the input images. If the images have their natural orientation, you are good to go. Image resizing and parsing are handled by the app, so you need not worry for that. Also, every ML model is prone to errors, hence it is important to mention that inaccuracies may be observed.

Great! I will spend some time to play around with the code. Have a nice day!

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 28, 2024

@michealChin Could you try using the abs function in BitmapUtils.kt like,

fun cropRectFromBitmap(source: Bitmap, rect: Rect ): Bitmap {
    var width = rect.width()
    var height = rect.height()
    rect.left = if( rect.left > 0 ) rect.left else 0
    rect.top = if( rect.top > 0 ) rect.top else 0
    if ( (rect.left + width) > source.width ){
        width = abs( source.width - rect.left )
    }
    if ( (rect.top + height ) > source.height ){
        height = abs( source.height - rect.top )
    }
    val croppedBitmap = Bitmap.createBitmap( source , rect.left , rect.top , width , height )
    // Uncomment the below line if you want to save the input image.
    // BitmapUtils.saveBitmap( context , croppedBitmap , "source" )
    return croppedBitmap
}

from facerecognition_with_facenet_android.

michealChin avatar michealChin commented on July 28, 2024

I call cropRectFromBitmap and pass in the image that located in the image folder and simply choose the Rect (0,0,100,100) and it successfully return me a crop bitmap without any exception. However Is this related to the apps crash with the error message I share in the post?

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 28, 2024

In some cases, source.width < rect.left which produces a negative number to be stored in width.

from facerecognition_with_facenet_android.

michealChin avatar michealChin commented on July 28, 2024

I got two folder actually, each folder with one image. I remove one of the folder and the apps no longer crash, may I know what is the specification for the bitmap to be read correctly by this project? Image Size (width and height)? Image Type?

Another question, you mention that Facenet is not very accurate, but according to https://paperswithcode.com/sota/face-verification-on-labeled-faces-in-the Facenet rank number 2 with 99.63% accuracy.

Anyway, you did a great job! Really appreciate your effort!

from facerecognition_with_facenet_android.

shubham0204 avatar shubham0204 commented on July 28, 2024

@michealChin There is no such specification on the input images. If the images have their natural orientation, you are good to go. Image resizing and parsing are handled by the app, so you need not worry for that. Also, every ML model is prone to errors, hence it is important to mention that inaccuracies may be observed.

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.