Platform - Flows

Ximilar Flows service provides a way for connecting individual categorization, tagging, regression, detection, similarity models as well as ready to use services into one REST API endpoint. With this service you can build more complex solutions in which you can aggregate result from multiple task/models or connect models with conditional dependencies/branches. In other words you can build powerful hierachical machine learning system on a few clicks!

For building flow, we provide easy to use ser interface for simple connecting your tasks into a Flow. After creating definition of flow you can call the prediction endpoint /v2/process. For newcomers, you can read our introduction blog post about flows. We have also video tutorial on youtube. If your flows are more complex, containing tens of models then you can call the service with asynchronous requests, not waiting on the results and possible to processing much more requests.

Flows - Use Cases

Ximilar Flows enables you to build sophisticated AI systems across various industries including fashion, e-commerce, healthcare, and real estate. Below are three practical examples demonstrating how to leverage Flows for different scenarios:

Unified API Endpoint for Multiple Models

Consider a real estate image analysis system that needs to perform multiple classifications simultaneously. The system needs to:

  • Classify room types (Bedroom, Kitchen, Bathroom, Living Room)
  • Identify home features (Wooden Floor, Fireplace, TV, etc.)
  • Assess property condition (Good, Average, Poor)

Instead of making three separate API calls (for our Image classification system), you can create a single Flow that processes all these tasks in parallel. This not only simplifies your integration but also improves performance by reducing network overhead.

Real estate flow

Hierarchical Classification System

For a fashion classification system, you can create a sophisticated hierarchical model that:

  • First identifies the main garment type (Pants vs Shirt)

Then branches into specific attributes based on the garment type:

  • For Pants: Length (long, 3/4, short) and Material (Denim, etc.)
  • For Shirts: Sleeve Length, Color, and Neckline Type

This is achieved by creating individual recognition tasks for each attribute and connecting them in a Flow using a branch selector. The branch selector intelligently routes the image through the appropriate classification path based on the initial garment type detection.

Fashion Flow

Object Detection with Recognition

For traffic monitoring systems, you can create a comprehensive vehicle analysis pipeline that:

  • Detects and classifies vehicles (Cars, Trucks, Motorcycles)
  • on images

Performs vehicle-specific analysis:

  • For Cars: Color and Brand/Type identification
  • For Trucks: Size classification (Small, Medium, Large)

This is implemented using an Object Selector Action with a "Vehicle Detector" task, followed by conditional recognition tasks that are triggered based on the detected vehicle type.

Detector flow


Flow Action types

Every flow consists of one or several actions (or another nested flows):

  • Branch Selector Action: Contains Image Recognition Task, based on the result from the task (labels), go to most probable branch (defined by label) which is default behaviour. Another mode is processing all of the branches where the label probability is bigger than some user specified value.

  • List Action: performs list of action in sequence or parallel (default)

  • Recognition Action: Performs Image Recognition Task and ouput is stored to field specified by user.

  • Detection Action: Performs Detection Task for predicting objects/bounding boxes and store it to the specified field.

  • Object Selector Action: Perform Detection Task, cut every detected object from image and further analyze them with next actions. You can threshold the probability or area and decide which objects should be analyzed.

  • Nested flow: calls another flow

  • Ximilar Service: calls ready to use image recognition tools as dominant colors, upscaling or remove background


POST/v2/process/

Call Flow

This is the main prediction endpoint of flow for your records. Similar to recognition/v2/classify endpoint, this endpoint also processes "records" with "_base64" or "_url" fields.

Required attributes

  • Name
    records
    Type
    array
    Description

    Array of record objects. Each record must contain either "_url" or "_base64" field. Maximum number of records is 10.

  • Name
    flow
    Type
    string
    Description

    ID of the flow to process the records with.

Returns

HTTP error code 2XX if the method was successful, and other HTTP error codes if the method failed. The response body contains the processed results according to your flow configuration.

Request

POST
/v2/process/
curl https://api.ximilar.com/flows/v2/process \
-H "Content-Type: application/json" \
-H "Authorization: Token __API_TOKEN__" \
-d '{
    "records": [
        {"_id": "__IMAGE_ID__", "_url": "__URL_IMAGE__" },
        {"_id": "__IMAGE_ID__", "_base64": "__BASE64_DATA__"}
    ],
    "flow": "__FLOW_ID__"
}'

Response

{
    "status": {
        "code": 200,
        "message": "OK"
    },
    "records": [
        {
            "_id": "__IMAGE_ID__",
            ...
        },
        {
            "_id": "__IMAGE_ID__",
            ...
        }
    ]
}

Was this page helpful?