Face Analyzer by Eachlabs
1019-face-analyzer
Face Analyzer by Each AI is an AI model that detects and analyzes gender, age, and race prediction.
Model Information
Input
Configure model parameters
Output
View generated results
Result
Preview, share or download your results with a single click.
{ "age": 25, "gender": "Woman", "race": "white" }
Prerequisites
- Create an API Key from the Eachlabs Console
- Install the required dependencies for your chosen language (e.g., requests for Python)
API Integration Steps
1. Create a Prediction
Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.
import requestsimport timeAPI_KEY = "YOUR_API_KEY" # Replace with your API keyHEADERS = {"X-API-Key": API_KEY,"Content-Type": "application/json"}def create_prediction():response = requests.post("https://api.eachlabs.ai/v1/prediction/",headers=HEADERS,json={"model": "1019-face-analyzer","version": "0.0.1","input": {"image_url": "your face image here"}})prediction = response.json()if prediction["status"] != "success":raise Exception(f"Prediction failed: {prediction}")return prediction["predictionID"]
2. Get Prediction Result
Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.
def get_prediction(prediction_id):while True:result = requests.get(f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",headers=HEADERS).json()if result["status"] == "success":return resultelif result["status"] == "error":raise Exception(f"Prediction failed: {result}")time.sleep(1) # Wait before polling again
3. Complete Example
Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.
try:# Create predictionprediction_id = create_prediction()print(f"Prediction created: {prediction_id}")# Get resultresult = get_prediction(prediction_id)print(f"Output URL: {result['output']}")print(f"Processing time: {result['metrics']['predict_time']}s")except Exception as e:print(f"Error: {e}")
Additional Information
- The API uses a two-step process: create prediction and poll for results
- Response time: ~16 seconds
- Rate limit: 60 requests/minute
- Concurrent requests: 10 maximum
- Use long-polling to check prediction status until completion
Overview
Eachlabs' Face Analyzer is an advanced deep learning model designed to analyze and process facial images for various purposes, such as age estimation and identity verification. This model leverages state-of-the-art algorithms to deliver accurate and efficient results.
Technical Specifications
Face Verification
Age and Gender Estimation
Facial Feature Analysis (e.g., race and ethnicity)
Key Considerations
Image Quality:
- Low-quality images or low resolutions may lead to inaccurate predictions.
If the output is in the format { "age": 25, "gender": "Woman", "race": "white" } and you need to access each value individually in the next steps, select the parameter in the input and write the keyword you want to access after placing a period.
Example:
{{step1.output.age}}
{{step1.output.gender}}
{{step1.output.race}}
Tips & Tricks
Make sure there is only one person in the photo.
The person's face should be clearly visible in the photo, with no shadows or half-face visible.
Capabilities
Detect facial expressions with high accuracy.
Predict individuals' age, gender, and ethnicity.
Provide detailed facial analysis for various use cases.
What can I use for?
Authentication and identity verification systems.
Creative applications such as character design or storytelling.
Enhancing image quality for professional or artistic projects
Things to be aware of
Environmental Factors:
The model may struggle in extreme lighting conditions or with occlusions (e.g., sunglasses, masks).
Age Progression:
The model may not reliably predict or verify faces across significant age differences (e.g., comparing a child to an adult).
Non-Facial Variations:
Accessories, hairstyles, or cultural facial features may affect predictions.
Limitations
The model performs best on frontal face images captured under good lighting conditions.
Results may vary with extreme facial angles or occlusions.
Output Format: Text