Tutorial : 2

Getting Started With FaceX and Sample Codes

Tutorial : Getting Started with FaceX and Sample Codes

Learn the basics of using FaceX to turn all your face-recognition application ideas to reality.


 

First off, Welcome to FaceX. We at heart are a very young team devoted to helping and caring personally for each and every one of our users. Don’t you worry, I’m not going to ask you to spend a single dollar to learn about our services.

 

When you place your trust in FaceX APIs we can promise you that we would never disappoint you. We too understand your frustration even if you are new to the API world or a seasoned veteran - Integration is darning difficult for most, that’s why we have made our step-by-step guide to creating a FaceX account to making your first API call and checking its results feel like a walk in the park.

 

Step 1: Creating a FaceX Developer Account.

 

This is the simplest part, all you need to do is click on the button below and make an account by filling the necessary fields. Note: We do not require your credit card details for this.

 

 

Once you make an account, a verification email with a link would be sent to your email which was providing while registering. Click on the link, activate your email and that's it - you are now a prized member of our FaceX’s Developer Family.

 

If you have not received the verification email or are facing any other issues in creating an account - please get in touch with our team via email at [email protected]

 

STEP 2: Get your User ID and User Key

 

The User ID and User Key credentials will authorize you to use our services and help you in tracking your usage analytics.

 

You can find your User ID and User Key by signing into your account here.

 

Once you sign-in the Dashboard would have a section that displays the credentials under the tab of Authentication Details - similar to the picture below. Keep a note of it and please do not share the User Id and User Key with anyone else.

heavylifting

 

STEP 3: Make your first API Call

 

The easiest way to embed is by making cURL requests. You could use Terminal (Mac) or Command Prompt (Windows) and type the command below.

 

CURL Code:

 

The code snippet below will help you integrate with our Image Attribute API which identifies every face in a picture and gives details such as Age Range, Gender with confidence, Chin, Eye nose position and many more. Images can be uploaded as files from your disk or via URLs. All you need to do is to replace the User ID and Key to your credentails and add the path to your image file in the form image_attr in the sample code.

 

 

Alternatively, you can also add the URL for an image file by replacing form image_attr with the URL. Code Snippet is provided below.

 

Within <500ms you would get a response similar to:

 

 

It’s that simple. Even a cat could do it.

heavylifting

 

Code Examples

You can find sample codes in PHP, Python, and jQuery below. All you need to do in the code below is to insert your User ID and User Key and edit the path to the image file in your laptop.

 

PHP

 

To upload an image as a file from your disk you can use the code below:


Upload an image using a URL from an external source


You can edit and save the file above and run it either in your local hosting server such as XAMPP, MAMP etc or on AWS/GoDaddy etc. Then proceed to your browser and point it to the file - VOILA! You can now see the response.

 

Python

 


After you save the file, open Terminal (Mac) or Command Prompt (Windows) and cd to your “file_folder” and Run: python filename.py

 

jQuery

 

To upload an image as a file from your disk:


To upload an image using a URL:

We do not recommend jQuery in production services as the Key and ID would be exposed in client browsers, But it should be fine if you are the only end customer.

 

Save the above file with .html extension and run it in your browser. You could navigate to the Inspector -> Console Logger and see your response there.