Hairstyle Extraction API

Extract and isolate hairstyles from images with the Hairstyle Extraction API, delivering PNG images with transparent backgrounds.

The Hairstyle Extraction API offers advanced image recognition capabilities to accurately identify and isolate hairstyles from images. By focusing on the head region of the person in the image, this API precisely extracts the hairstyle and outputs it as a PNG file with a transparent background. This functionality is ideal for applications in virtual try-ons, fashion analysis, and digital content creation. Integrate the Hairstyle Extraction API to provide users with the ability to effortlessly separate hairstyles from their images, facilitating a wide range of creative and professional uses.

Application Scenarios

  • Wig network try: through the hair segmentation, after intercepting the hair of the self-timer, change it into a wig image, you can directly see the effect of the wig try, eliminating the need to return or replace the goods after online shopping wear inappropriate troubles.
  • Barbershop hairstyle try: hairstylists guide customers through the tablet or cell phone shot of their own headshot, changed into a variety of hairstyles, have a more intuitive feeling. Customers can choose their favorite hairstyle and let the hairstylist take care of them.

Featured Advantages

  • Precise segmentation of hair edges: The edges of hair can be precisely segmented, and the editing result of the image after segmentation has no sense of contradiction.

Rendering

Original Image

Original Image

Result Image

Result Image

Documentación de la API

Endpoints


Extract and isolate hairstyles from images with the Hairstyle Extraction API, delivering PNG images with transparent backgrounds.

Request

Image requirements

  • Image format: JPEG JPG BMP PNG
  • Image size: No more than 3 MB.
  • Image resolution: Larger than 32x32px, smaller than 2000x2000px.

Body

Field Required Type
image YES file

Response

Public Parameters

Viewing Public Parameters and Error Codes

Business Parameters

Field Type Description
data object The content of the result data returned.
+elements array The keying result of each child element.
++image_url string Resulting image URL address.
++width integer The width of the result map.
++height integer The height of the resultant graph.
++x integer Top left x-coordinate.
++y integer Top left y-coordinate.

The URL address is a temporary address, valid for 24 hours, and will not be accessible after it expires. If you need to save the file for a long time or permanently, please visit the URL address within 24 hours and download the file to your own storage space.

Example

{
  "request_id": "",
  "log_id": "",
  "error_code": 0,
  "error_code_str": "",
  "error_msg": "",
  "error_detail": {
    "status_code": 200,
    "code": "",
    "code_message": "",
    "message": ""
  },
  "data": {
    "elements": [
      {
        "image_url": "",
        "width": 0,
        "height": 0,
        "x": 0,
        "y": 0
      }
    ]
  }
}


                                                                            
POST https://zylalabs.com/api/4407/hairstyle+extraction+api/5416/hairstyle+extraction
                                                                            
                                                                        

Hairstyle Extraction - Características del Endpoint

Objeto Descripción
Cuerpo de la Solicitud [Requerido] Archivo Binario
Probar Endpoint

RESPUESTA DE EJEMPLO DE LA API

       
                                                                                                        
                                                                                                                                                                                                                            {"data":{"elements":[{"x":471,"image_url":"https:\/\/ai-result-rapidapi.ailabtools.com\/cutout\/segmentHair\/2024-06-13\/122108-5d6c46f6-bf35-7f1d-d606-f17d08a30164-1718281268.png","y":0,"height":604,"width":674}]},"error_code":0,"error_detail":{"status_code":200,"code":"","code_message":"","message":""},"log_id":"523E6370-C04C-53A6-B6CF-471337E2B22B","request_id":"523E6370-C04C-53A6-B6CF-471337E2B22B"}
                                                                                                                                                                                                                    
                                                                                                    

Hairstyle Extraction - CÓDIGOS DE EJEMPLO


    curl --location 'https://zylalabs.com/api/4407/hairstyle+extraction+api/5416/hairstyle+extraction' \
    --header 'Content-Type: application/json' \ 
    --form 'image=@"FILE_PATH"'


Clave de Acceso a la API y Autenticación

Después de registrarte, a cada desarrollador se le asigna una clave de acceso a la API personal, una combinación única de letras y dígitos proporcionada para acceder a nuestro endpoint de la API. Para autenticarte con el Hairstyle Extraction API simplemente incluye tu token de portador en el encabezado de Autorización.
Encabezados
Encabezado Descripción
Autorización [Requerido] Debería ser Bearer access_key. Consulta "Tu Clave de Acceso a la API" arriba cuando estés suscrito.

Precios Simples y Transparentes

Sin compromiso a largo plazo. Mejora, reduce o cancela en cualquier momento.

🚀 PLAN CORPORATIVO A MEDIDA

Comienza en
$ 10.000/Año


  • Volumen Personalizado
  • Límite de solicitudes personalizado
  • Soporte al Cliente Especializado
  • Monitoreo de API en Tiempo Real

Funciones favoritas de los clientes

  • ✔︎ Paga Solo por Solicitudes Exitosas
  • ✔︎ Prueba Gratuita de 7 Días
  • ✔︎ Soporte Multilenguaje
  • ✔︎ Una Clave API, Todas las APIs.
  • ✔︎ Panel de Control Intuitivo
  • ✔︎ Manejo de Errores Integral
  • ✔︎ Documentación Amigable para Desarrolladores
  • ✔︎ Integración con Postman
  • ✔︎ Conexiones HTTPS Seguras
  • ✔︎ Tiempo de Actividad Fiable

Hairstyle Extraction API FAQs

The Hairstyle Extraction API offers advanced image recognition capabilities to accurately identify and isolate hairstyles from images. By focusing on the head region of the person in the image, this API precisely extracts the hairstyle and outputs it as a PNG file with a transparent background.

Virtual Hairstyling Apps: Providing users with the ability to try on different hairstyles virtually by extracting and overlaying various haircuts onto their photos. Beauty and Fashion Industry: Assisting hairstylists, salons, and beauty professionals in showcasing different hairstyles and trends through virtual makeovers and consultations. E-commerce Platforms: Enhancing the visual representation of hair products, such as wigs, extensions, and hair accessories, by extracting and showcasing the hairstyles on models or mannequins.

Precision and Detail: Ensures accurate extraction of hairstyles, preserving intricate details and textures for realistic visualizations. Time Efficiency: Streamlines the hairstyling process, saving time for both users and professionals during consultations or virtual makeovers. Versatility: Applicable to a wide range of hairstyles, including short, long, curly, and straight, catering to diverse user preferences and needs. Visual Realism: Provides lifelike representations of hairstyles, allowing users to visualize how different looks will complement their facial features and overall appearance.

We have designed a dedicated experience page for developer users. You can visit the experience page to try out the product for free: https://www.ailabtools.com/cutout-hair-extraction-example

Yes, we do have more detailed [API documentation](https://www.ailabtools.com/doc/ai-cutout/portrait/hairstyle-extraction/api-marketplace) available. You can access it on our website or by contacting our support team for assistance.

The Hairstyle Extraction API returns a JSON object containing the extracted hairstyle data, including the image URL, dimensions (width and height), and coordinates (x and y) for the extracted hairstyle.

The key fields in the response data include `image_url` (URL of the extracted hairstyle), `width` (width of the image), `height` (height of the image), `x` (top left x-coordinate), and `y` (top left y-coordinate).

The response data is structured as a JSON object with a `data` field containing an `elements` array. Each element in the array represents an extracted hairstyle with its associated properties.

The primary parameter for the Hairstyle Extraction endpoint is the `image`, which must be a file in supported formats (JPEG, JPG, BMP, PNG) and meet size and resolution requirements.

Users can utilize the returned data by accessing the `image_url` to download the extracted hairstyle image. The width and height can help in displaying the image correctly in applications, while the coordinates assist in positioning the hairstyle overlay.

Typical use cases include virtual wig try-ons, barbershop consultations, and fashion analysis, where users can visualize different hairstyles on their images for better decision-making.

Data accuracy is maintained through advanced image recognition algorithms that focus on precise segmentation of hairstyles, ensuring realistic and high-quality extractions from user-uploaded images.

If users receive partial or empty results, they should check the input image for compliance with the API's requirements (format, size, resolution) and ensure that the head region is clearly visible for optimal extraction.

General FAQs

Zyla API Hub es como una gran tienda de APIs, donde puedes encontrar miles de ellas en un solo lugar. También ofrecemos soporte dedicado y monitoreo en tiempo real de todas las APIs. Una vez que te registres, puedes elegir qué APIs quieres usar. Solo recuerda que cada API necesita su propia suscripción. Pero si te suscribes a varias, usarás la misma clave para todas, lo que hace todo más fácil para ti.

Los precios se muestran en USD (dólar estadounidense), EUR (euro), CAD (dólar canadiense), AUD (dólar australiano) y GBP (libra esterlina). Aceptamos todas las principales tarjetas de débito y crédito. Nuestro sistema de pago utiliza la última tecnología de seguridad y está respaldado por Stripe, una de las compañías de pago más confiables del mundo. Si tienes algún problema para pagar con tarjeta, contáctanos en [email protected]


Además, si ya tienes una suscripción activa en cualquiera de estas monedas (USD, EUR, CAD, AUD, GBP), esa moneda se mantendrá para suscripciones posteriores. Puedes cambiar la moneda en cualquier momento siempre que no tengas suscripciones activas.

La moneda local que aparece en la página de precios se basa en el país de tu dirección IP y se proporciona solo como referencia. Los precios reales están en USD (dólar estadounidense). Cuando realices un pago, el cargo aparecerá en tu estado de cuenta en USD, incluso si ves el monto equivalente en tu moneda local en nuestro sitio web. Esto significa que no puedes pagar directamente en tu moneda local.

Ocasionalmente, un banco puede rechazar el cargo debido a sus configuraciones de protección contra fraude. Te sugerimos comunicarte con tu banco primero para verificar si están bloqueando nuestros cargos. También puedes acceder al Portal de Facturación y cambiar la tarjeta asociada para realizar el pago. Si esto no funciona y necesitas más ayuda, por favor contacta a nuestro equipo en [email protected]

Los precios se determinan mediante una suscripción recurrente mensual o anual, dependiendo del plan elegido.

Las llamadas a la API se descuentan de tu plan en base a solicitudes exitosas. Cada plan incluye una cantidad específica de llamadas que puedes realizar por mes. Solo las llamadas exitosas, indicadas por una respuesta con estado 200, se contarán en tu total. Esto asegura que las solicitudes fallidas o incompletas no afecten tu cuota mensual.

Zyla API Hub funciona con un sistema de suscripción mensual recurrente. Tu ciclo de facturación comenzará el día en que compres uno de los planes de pago, y se renovará el mismo día del mes siguiente. Así que recuerda cancelar tu suscripción antes si quieres evitar futuros cargos.

Para actualizar tu plan de suscripción actual, simplemente ve a la página de precios de la API y selecciona el plan al que deseas actualizarte. La actualización será instantánea, permitiéndote disfrutar inmediatamente de las funciones del nuevo plan. Ten en cuenta que las llamadas restantes de tu plan anterior no se transferirán al nuevo plan, por lo que debes considerar esto al actualizar. Se te cobrará el monto total del nuevo plan.

Para verificar cuántas llamadas a la API te quedan en el mes actual, revisa el campo 'X-Zyla-API-Calls-Monthly-Remaining' en el encabezado de la respuesta. Por ejemplo, si tu plan permite 1,000 solicitudes por mes y has usado 100, este campo mostrará 900 llamadas restantes.

Para ver el número máximo de solicitudes a la API que permite tu plan, revisa el encabezado de la respuesta 'X-Zyla-RateLimit-Limit'. Por ejemplo, si tu plan incluye 1,000 solicitudes por mes, este encabezado mostrará 1,000.

El encabezado 'X-Zyla-RateLimit-Reset' muestra el número de segundos hasta que tu límite se restablezca. Esto te indica cuándo tu conteo de solicitudes se reiniciará. Por ejemplo, si muestra 3,600, significa que faltan 3,600 segundos para que el límite se restablezca.

Sí, puedes cancelar tu plan en cualquier momento desde tu cuenta, seleccionando la opción de cancelación en la página de Facturación. Ten en cuenta que las actualizaciones, degradaciones y cancelaciones tienen efecto inmediato. Además, al cancelar ya no tendrás acceso al servicio, incluso si te quedaban llamadas en tu cuota.

Puedes contactarnos a través de nuestro canal de chat para recibir asistencia inmediata. Siempre estamos en línea de 8 a. m. a 5 p. m. (EST). Si nos contactas fuera de ese horario, te responderemos lo antes posible. Además, puedes escribirnos por correo electrónico a [email protected]

Para darte la oportunidad de probar nuestras APIs sin compromiso, ofrecemos una prueba gratuita de 7 días que te permite realizar hasta 50 llamadas a la API sin costo. Esta prueba solo se puede usar una vez, por lo que recomendamos aplicarla a la API que más te interese. Aunque la mayoría de nuestras APIs ofrecen prueba gratuita, algunas pueden no hacerlo. La prueba finaliza después de 7 días o cuando realices 50 solicitudes, lo que ocurra primero. Si alcanzas el límite de 50 solicitudes durante la prueba, deberás "Iniciar tu Plan de Pago" para continuar haciendo solicitudes. Puedes encontrar el botón "Iniciar tu Plan de Pago" en tu perfil bajo Suscripción -> Elige la API a la que estás suscrito -> Pestaña de Precios. Alternativamente, si no cancelas tu suscripción antes del día 7, tu prueba gratuita finalizará y tu plan se cobrará automáticamente, otorgándote acceso a todas las llamadas a la API especificadas en tu plan. Ten esto en cuenta para evitar cargos no deseados.

Después de 7 días, se te cobrará el monto total del plan al que estabas suscrito durante la prueba. Por lo tanto, es importante cancelar antes de que finalice el periodo de prueba. No se aceptan solicitudes de reembolso por olvidar cancelar a tiempo.

Cuando te suscribes a una prueba gratuita de una API, puedes realizar hasta 50 llamadas. Si deseas realizar más llamadas después de este límite, la API te pedirá que "Inicies tu Plan de Pago". Puedes encontrar el botón "Iniciar tu Plan de Pago" en tu perfil bajo Suscripción -> Elige la API a la que estás suscrito -> Pestaña de Precios.

Las Órdenes de Pago se procesan entre el día 20 y el 30 de cada mes. Si envías tu solicitud antes del día 20, tu pago será procesado dentro de ese período.


APIs Relacionadas


También te puede interesar