GithubHelp home page GithubHelp logo

microsoft / cognitive-face-android Goto Github PK

View Code? Open in Web Editor NEW
272.0 76.0 154.0 4.01 MB

Cognitive Services Face client library for Android.

Home Page: https://www.microsoft.com/cognitive-services/en-us/face-api

License: Other

Java 100.00%
microsoft-cognitive-services microsoft sdk android face-api sample cognitive-services face

cognitive-face-android's Introduction

This repository has been retired. Please visit the Face QuickStart to get started with the latest Face SDKs.

Microsoft Face API: Android Client Library & Sample

This repo contains the Android client library & sample for the Microsoft Face API, an offering within Microsoft Cognitive Services, formerly known as Project Oxford.

The Client Library

The Face API client library is a thin Java client wrapper for Microsoft Face API.

The client library is indexed on Maven Central Repository with all versions here.

Invoke the client library

There are two recommended approaches to introduce the client library in other application projects.

To add the client library dependency via build.gradle file, add the following entry in the dependencies section.

dependencies {
    //
    // Use the following line to include client library from Maven Central Repository
    // Change the version number with the latest version according to the search.maven.org result
    //
    implementation 'com.microsoft.projectoxford:face:1.4.3'

    // Your other Dependencies...
}

To add the client library dependency via Android Studio:

  1. From Menu, Choose File > Project Structure.
  2. Click on your app module.
  3. Click on Dependencies tab.
  4. Click "+" sign to add new dependency.
  5. Pick "Library dependency" from the drop down list.
  6. Type "com.microsoft.projectoxford" and hit the search icon from "Choose Library Dependency" dialog.
  7. Pick the Project Oxford client library that you intend to use.
  8. Click "OK" to add the new dependency.

The Sample

This sample is an Android application to demonstrate the use of Microsoft Face API. It demonstrates face detection, face verification, face grouping, finding similar faces, and face identification functionalities.

Requirements

Android OS must be Android 5.1 or higher (API Level 22 or higher).

Build the Sample

  1. First, you must obtain a Face API subscription key by following the instructions on our website.
  2. Start Android Studio and open project from Face > Android > Sample folder.
  3. In Android Studio -> "Project" panel -> "Android" view, open file "app/res/values/strings.xml", and find the line "Please_add_the_subscription_key_here;". Replace the "Please_add_the_subscription_key_here" value with your subscription key string from the first step. If you cannot find the file "strings.xml", it is in folder "Sample\app\src\main\res\values\string.xml".
  4. In Android Studio, select menu "Build > Make Project" to build the sample.

Run the sample

In Android Studio, select menu "Run", and "Run app" to launch this sample app.

Once the app is launched, click on buttons to use samples of between different scenarios, and follow the instructions on screen.

Microsoft will receive the images you upload and may use them to improve Face API and related services. By submitting an image, you confirm you have consent from everyone in it.

Updates

Contributing

We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see LICENSE.

Sample images are licensed separately, please refer to LICENSE-IMAGE.

Developer Code of Conduct

Developers using Cognitive Services, including this client library & sample, are expected to follow the “Developer Code of Conduct for Microsoft Cognitive Services”, found at http://go.microsoft.com/fwlink/?LinkId=698895.

cognitive-face-android's People

Contributors

carlosgub avatar cthrash avatar huxuan avatar lebronj avatar lightfrenzy avatar longli0 avatar msftgits avatar naterickard avatar rishitoshsingh avatar sldi-microsoft avatar vernazza avatar wangjun-microsoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cognitive-face-android's Issues

AddFaceToPersonActivity: AsyncTask executed in onResume

In the Sample code AddFaceToPersonActivity, I saw that DetectionTask is executed in onResume but not onCreate. I can't understand how does it work. Can you please help me?

`@Override
protected void onResume() {
super.onResume();

    Uri imageUri = Uri.parse(mImageUriStr);
    mBitmap = ImageHelper.loadSizeLimitedBitmapFromUri(
            imageUri, getContentResolver());
    if (mBitmap != null) {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
        InputStream imageInputStream = new ByteArrayInputStream(stream.toByteArray());
        addLog("Request: Detecting " + mImageUriStr);
        new DetectionTask().execute(imageInputStream);
    }
}`

Person group training status is Failed

In the log, I saw that the person group has been successfully trained, but when I tried to identify a photo, it shows warning "Person group training status is Failed".

How to merge two microsoft sample apps

How can I join https://github.com/Microsoft/Cognitive-Vision-Android with https://github.com/Microsoft/Cognitive-Face-Android so that both apps are combined into one. As I was looking to make an app which combined both technologies to help blind people familiarise themselves with certain things by letting them know what it is. Can you please send me the file/folder with the solution by providing a link to it and how and where I can use it as I'm pretty new to android app development. When someone provides the code I need to know where to add it and test it that it works. So basically I am trying to create a similar app to Seeing AI. All help is well appreciated. Thanks

Microsoft-Cognitive add new person with chinese name

After I import 1.4.2 arr file in my project, I even got 'java.nio.charset.CharsetICU[UTF-8]' exception when I use faceServiceClient.identity ! I originally could use this function at 1.4.1 version @@
faceServiceClient.identity( this.mPersonGroupId, uuids, 1);
And got java.io.UnsupportedEncodingException: java.nio.charset.CharsetICU[UTF-8] when I use faceServiceClient.trainPersonGroup(groupName[0]);

我。。又来了,关于两张人脸对比那个activity的字符编码问题

FaceVerificationActivity, 进行验证的时候

@OverRide
protected VerifyResult doInBackground(Void... params) {
// Get an instance of face service client to detect faces in image.
FaceServiceClient faceServiceClient = SampleApp.getFaceServiceClient();
try {
publishProgress("Verifying...");

            // Start verification.
            return faceServiceClient.verify(
                    mFaceId0,      /* The first face ID to verify */
                    mFaceId1);     /* The second face ID to verify */
        } catch (Exception e) {
            publishProgress(e.getMessage());  // 在这里 出现了异常java.io.UnsupportedEncodingException: java.nio.charset.CharsetICU[UTF-8]
            addLog(e.getMessage());
            return null;
        }
    }

···

出现了异常java.io.UnsupportedEncodingException: java.nio.charset.CharsetICU[UTF-8],我发现两个faceid都不是string类型,无从下手了 请问我该如何处理

data sorage

can any one please tell me where image data and person group name and person name is stored and can i put it in mysql or sqllite

Large person group not trained

This is error not showing in the sample, but once i cloned it in my project then only error occurs, Anybody help me

com.microsoft.projectoxford.face.rest.ClientException: Large person group not trained.

Did they change the reference and documentation ?

The reference for java in here https://docs.microsoft.com/en-us/java/api/overview/azure/cognitiveservices/client/faceapi?view=azure-java-stable doesn't make any sense when i implement com.microsoft.projectoxford:face:1.4.4.

Like in the sample file this was used to authenticate :
sFaceServiceClient = new FaceServiceRestClient(getString(R.string.endpoint), getString(R.string.subscription_key));

But in the doc :

public static FaceAPI authenticate(String baseUrl, final String subscriptionKey)

Reading this make me want to commit suicide.

Face Verification

When we select first photo and then try to select the second photo the previous photo gets removed so the verify button is not getting enabled. And also selecting any button after the selection of the photo will remove the selected photo
Please kindly give a solution to this.

Sample app crashes on Android 9

Sample app crashes on Android 9.

com.microsoft.projectoxford.faceapisample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.microsoft.projectoxford.faceapisample, PID: 12223
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/client/DefaultHttpClient;
at com.microsoft.projectoxford.face.rest.WebServiceRequest.(WebServiceRequest.java:67)
at com.microsoft.projectoxford.face.FaceServiceRestClient.(FaceServiceRestClient.java:99)
at com.microsoft.projectoxford.face.samples.helper.SampleApp.onCreate(SampleApp.java:45)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.impl.client.DefaultHttpClient" on path: DexPathList[[zip file "/data/app/com.microsoft.projectoxford.faceapisample-mX1hJpaMtqiI69OayytOcQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.microsoft.projectoxford.faceapisample-mX1hJpaMtqiI69OayytOcQ==/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.microsoft.projectoxford.face.rest.WebServiceRequest.(WebServiceRequest.java:67) 
at com.microsoft.projectoxford.face.FaceServiceRestClient.(FaceServiceRestClient.java:99) 
at com.microsoft.projectoxford.face.samples.helper.SampleApp.onCreate(SampleApp.java:45) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871) 
at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

Please add this to AndroidManifest.xml:
<uses-library android:name="org.apache.http.legacy" android:required="false" />

Thanks.

Face API - Adding image to a group not saving

All are working except when I use the Identification Button. I was able to add a Group and also able to add Persons within the group and they get saved. However, when i start to add the images for Person A, emulator will show the image but when I click Save, the image did not get added to Person A. It is not getting saved. The download of this app was as of June 6, 2017. See the screenshot.
faceapi4
Any help is appreciated.
Thanks

open camera error

It says = "Microsoft Cognitive Service Face has stopped." Open app again.
why ?
thankyou

JsonSyntaxException at FaceServiceRestClient.getPersonGroupTrainingStatus??

Hi there. I am working on identifying a face. But when I run this line to get the training status

TrainingStatus trainingStatus = faceServiceClient.getPersonGroupTrainingStatus(groupID);

I get the JsonSyntaxException and I am not so sure how to fix it.

Logs from console:

03-02 12:01:10.035 18597-19544/? W/System.err: com.google.gson.JsonSyntaxException: 03/01/2018 23:00:09
03-02 12:01:10.035 18597-19544/? W/System.err: at com.google.gson.DefaultDateTypeAdapter.deserializeToDate(DefaultDateTypeAdapter.java:127)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.DefaultDateTypeAdapter.read(DefaultDateTypeAdapter.java:103)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.DefaultDateTypeAdapter.read(DefaultDateTypeAdapter.java:40)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.Gson.fromJson(Gson.java:888)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.Gson.fromJson(Gson.java:853)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.Gson.fromJson(Gson.java:802)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.google.gson.Gson.fromJson(Gson.java:774)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.microsoft.projectoxford.face.FaceServiceRestClient.getPersonGroupTrainingStatus(FaceServiceRestClient.java:454)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.sunny.myproject.Preview$IdentificationTask.doInBackground(Preview.java:312)
03-02 12:01:10.036 18597-19544/? W/System.err: at com.sunny.myproject.Preview$IdentificationTask.doInBackground(Preview.java:296)
03-02 12:01:10.036 18597-19544/? W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:305)
03-02 12:01:10.036 18597-19544/? W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-02 12:01:10.036 18597-19544/? W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
03-02 12:01:10.036 18597-19544/? W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
03-02 12:01:10.036 18597-19544/? W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
03-02 12:01:10.036 18597-19544/? W/System.err: at java.lang.Thread.run(Thread.java:762)
03-02 12:01:10.037 18597-19544/? W/System.err: Caused by: java.text.ParseException: Failed to parse date ["03/01/2018 23:00:09']: Invalid number: 03/0
03-02 12:01:10.037 18597-19544/? W/System.err: at com.google.gson.internal.bind.util.ISO8601Utils.parse(ISO8601Utils.java:274)
03-02 12:01:10.037 18597-19544/? W/System.err: at com.google.gson.DefaultDateTypeAdapter.deserializeToDate(DefaultDateTypeAdapter.java:125)
03-02 12:01:10.037 18597-19544/? W/System.err: ... 17 more
03-02 12:01:10.037 18597-19544/? W/System.err: Caused by: java.lang.NumberFormatException: Invalid number: 03/0
03-02 12:01:10.037 18597-19544/? W/System.err: at com.google.gson.internal.bind.util.ISO8601Utils.parseInt(ISO8601Utils.java:318)
03-02 12:01:10.037 18597-19544/? W/System.err: at com.google.gson.internal.bind.util.ISO8601Utils.parse(ISO8601Utils.java:129)
03-02 12:01:10.038 18597-19544/? W/System.err: ... 18 more

Usage in SDK > 22

As I was developing a new Android app, I had tremendous problems using the library as is due to the mixing of SDK versions. When I tried to use the library as is (bumping my minSdkVersion down to 22) I not only had libraries that didn't work but the compiler complaining that Google Play wanted at least v26. If I tried to bump my minSdkVersion up to 24 or 26 of course the library would throw an exception on load. I have taken a copy of the code and compiled with the following:
android {
compileSdkVersion 26

defaultConfig {
    minSdkVersion 22
    targetSdkVersion 26
}
compileOptions {
    sourceCompatibility '1.8'
    targetCompatibility '1.8'
}

}
that seems to work with my app defined as:
compileSdkVersion 28
defaultConfig {
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
}

Should I simply submit a PR? Are you taking them?

Not able to import the project into my android studio

I tried importing the project into the android studio, but has lot of errors while building the project.
i feel the project structure is not proper, when we import project into android studio, the project structure would be something like this.
app-> manifest , java, res
Gradle scripts - > build.gradle(project : sample), build.gradle(Module:app), gradle properties, settings.properties, setting.gradle, local.properitie, proguard-rules.pro

but after importing your projects into android studio, everything got messed up.

Please write a step by step procedure to import the project into android studio for successfull demo.

Thank you
Krishna P

Disappointing Results

I tried this library a few years ago when it first came out. It was pretty good.

Now I tried again. It is now so slow. And it can't even detect a simple face from a simple photo. Your API seems to have gotten worse... What happened?

facelist.faceGroupId not set

When reading all face lists with FaceServiceRestClient.listFaceLists(), an array of FaceListMetadata objects is returned. But the attribute faceGroupId is null on all objects. This id is necessary to delete such a list.

Is it a naming problem? faceGroupId/faceListId?

about

if I use the dependency of 'compile 'com.microsoft.projectoxford:face:1.4.1'' , when the android-studio was building it ,it told me 'Error:(15) error: unknown element found.' ,then I delete the dependency of ' compile 'com.microsoft.projectoxford:face:1.4.1'' ,and use the local module lib ,it was ok!

Sample app crashes on Take picture option

Application is crashing when I select "Take picture" Option.

12-01 11:25:21.648 15151-15151/com.microsoft.projectoxford.faceapisample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.microsoft.projectoxford.faceapisample, PID: 15151
java.lang.IllegalStateException: Could not execute method for android:onClick
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
at android.view.View.performClick(View.java:6305)
at android.view.View$PerformClick.run(View.java:24840)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
at android.view.View.performClick(View.java:6305) 
at android.view.View$PerformClick.run(View.java:24840) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6501) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

Caused by: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.microsoft.projectoxford.faceapisample/files/Pictures/IMG_4425260963990859387.jpg exposed beyond app through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1962)
at android.net.Uri.checkFileUriExposed(Uri.java:2356)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:942)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9850)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9835)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1612)
at android.app.Activity.startActivityForResult(Activity.java:4514)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:4472)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at com.microsoft.projectoxford.face.samples.ui.SelectImageActivity.takePhoto(SelectImageActivity.java:115)
at java.lang.reflect.Method.invoke(Native Method) 
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 
at android.view.View.performClick(View.java:6305) 
at android.view.View$PerformClick.run(View.java:24840) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6501) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

Confidence

Hi what is the general rule of thumb for the confidence in Microsoft Cognitive Services? Do you have any graph or anything available which states if it is less than 50% don't trust the results and if it is above 50% do trust the results. Like also if it is 90%+ it is extremely accurate results etc.

Actual API Level Requirement

It is stated:

"Android OS must be Android 4.1 or higher (API Level 16 or higher)." However, to use the library (as described) an API level of at least 22 is required!

Manifest merger failed : uses-sdk:minSdkVersion 17 cannot be smaller than version 22 declared in library [com.microsoft.projectoxford:face:1.4.3] C:\Users\Jeffrey.gradle\caches\transforms-1\files-1.1\face-1.4.3.aar\c27440009e99f6447afc74ec8bfeed96\AndroidManifest.xml as the library might be using APIs not available in 17
Suggestion: use a compatible library with a minSdk of at most 17,
or increase this project's minSdk version to at least 22,
or use tools:overrideLibrary="com.microsoft.projectoxford.face" to force usage (may lead to runtime failures)

Importing the project into android studio

i have downloaded the code from github, it has sample, data, client library . i am bit confused which part to import in my android studio. i tried importing sample part but it was throwing lot of errors while building the project. Please suggest me how to import it properly so that i can be able to run the code properly to see the FACE API demo.

Thanks in advance,
Krishna P

Build fail with Android Studio 5.0

Just yesterday, when I went to sleep, I pushed my project to my repository and then I received an email from github because I had google API key hard coded to my project.

I clicked to stay safe and whatever, thinking they would just pass the hardcode to a property file or something.

But today, when I updated my repository, my Grandle Build was all desconfigurated, without all my dependencies, even the older versions and all my folders was out of place.
I'm trying to fix but I have college work for tomorrow, that I needed to show it.

Please, there is a way to I recover my last project? Before "I dont know what you did"?

Repository: appraja

I have problem with detecting face. It may has problem with the key.

I'm trying to detect and draw a rectangle frame in a picture (in drawable folder) just for testing this API is working well in my project. But it doesn't work like this. I have log '11111111111111111111111111' in Android Monitor that means the 'face == null'....
face

please help me..!

I have NullPointerException with createPerson.

image

Hi, I'm using this API for my application.
I wanna use the method 'createPerson' as the top image, but I got the NullPointerException like this.

image

The exception line 45 is on ①, and the line 24 is on ② that I wrote with red pen.. (the line number is not excactly equal with the top image, because I delete annotation for capture.)

I wrote the class and method the same as with Sample App.. but I don't know why this happens..
Please help me! T-T

Null object reference

am getting the follow error attempt to invooke
image
the sample app code is
image
kindly assist

FaceServiceClient.detect returns faceid = null

I'm using FaceServiceClient.detect to detect a face in a photo containing only one face.
For most of the photos it works.
But for some photos the function FaceServiceClient.detect returns one Face object but with faceid = null. i.e. it returns a List object with one Face but that Face has faceid = null and I cannot use it later for verification.

this is my code:

faceServiceClient.detect(
                        params[0],  /* Input stream of image to detect */
                        true,       /* Whether to return face ID */
                        false,       /* Whether to return face landmarks */
                        /* Which face attributes to analyze, currently we support:
                           age,gender,headPose,smile,facialHair */
                        null);

Why does that happen?
Is there any reason why FaceServiceClient.detect returns a Face with faceid null?

Build fail with Android Studio 3.0

Hi,
I encounter an error unknown element <library> found when compiling this library with Android Studio 3.0 released today and gradle 3.0.0. Screenshot: https://imgur.com/a/qcy5e

Dependencies as below, only default implementation and face 1.3.0.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    implementation 'com.microsoft.projectoxford:face:1.3.0'
}

Any reply will be appreciated. Thanks!

Basic Question

I am new to Android Studio/ programming. I am trying to build the project after setting the Key, and it is throwing an error - saying sdk not found. Please help.

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.