Get started

We assist civil and structural engineers, inspectors, and organizations in continuous monitoring and realtime assessment of the conditions of road bridges to enhance their infrastructure maintenance program. Our AI algorithms process images or video frames to detect various types of bridge defects, such as corrosion, cracks, abnormal spacing, functional disorder of bearings, spalling/exposed rebar, etc. and identify the severity ratings of those defects.


Our current AI-based solution is optimized for concrete bridges.


We have developed a customizable API that can be readily used for any use-case at hand or can be fine-tuned further to expand the list of bridge defects. The flexibility of our API allows developers easily modify and seamlessly integrate the end-product into their own workflows.


You will need a key to use our API . please reach out to us at [email protected]

Try It Now

Examples:

Disclaimer: We have set a filter for image analysis. If an image is caught by the filter, the expected result might not display correctly.
However, direct API usage will work for all elements, regardless of the filter.



Drag image file here or

Stylized mountain icon

Installation

To install the API client, you can use pip (Python's package manager). Ensure you have Python installed on your system. Run the following command in your terminal or command prompt:

                
                    pip install smretrofit
                
            

After installation, you can import the API client into your Python scripts and start making requests. Ensure that you have the correct authentication credentials (API key and password) to interact with the API successfully.

For more information and documentation, visit the GitHub repository.

If you encounter any issues or have questions, please check the GitHub Issues page for support.

Parameters

To detect construction defects and ratings, make a POST request to the following URL:
https://api.somikoron.ai/api


CLASS PARAMETERS

Following Paramiters are for API Class

Field Type Default Min/Max Description
url String https://api.somikoron.ai/api/ The API endpoint URL.
auth_key String Your API key for authentication.
auth_pass String Your API password for authentication.
font_size Integer 7 0 - 15 (optional) The size of the font used for labels.
font_thickness Integer 3 0 - 10 (optional) The thickness of the font used for labels.
line_space Integer 10 0 - 50 (optional) The space between lines of text in the output.
mode String "all" "all", "defect", "rating" The mode for displaying labels in the output. Parameters are: "all", "defect", and "rating".

IMAGE FUNCTION PARAMETERS

Following Paramiters are for image_data function

Field Type Default Min/Max Description
file_path String The path of the input video or image file to be processed.
save Boolean False True - False Indicates whether the rendered image will be saved.
output String "output/" The path of the output directory where the processed images or videos will be saved.

VIDEO FUNCTION PARAMETERS

Following Paramiters are for video_data function

Field Type Default Min/Max Description
file_path String The path of the input video or image file to be processed.
save Boolean False True - False Indicates whether the rendered image will be saved or not (True : False).
output String "output/" The path of the output directory where the processed images or videos will be saved.
temp String "temp/" The path of the temporary directory used for frame extraction during video processing.

VIDEO SAMPLE FUNCTION PARAMETERS

Following Paramiters are for video_data function

Field Type Default Min/Max Description
file_path String The path of the input video or image file to be processed.
save Boolean "False" True - False Indicates whether the rendered image will be saved or not (True : False).
sample Integer 3 1 - 100 Total number of frames to be processed as images from the video as demonstrates.
output String "output/" The path of the output directory where the processed images or videos will be saved.
temp String "temp/" The path of the temporary directory used for frame extraction during video processing.

Code Example

A basic code example is provided below to help you get started with using the API. This example demonstrates how to make a request to the API and process the results. You can customize it based on your specific needs.


import Retrofit as api
# Import Retrofit as 'api'
url = "https://api.somikoron.ai/api/"
# This is the API endpoint URL for sending requests
auth_key="your_api_key"
# Replace 'your_api_key' with the actual API key provided for authentication.
auth_pass="your_api_password"
# Replace 'your_api_password' with the actual API password provided for authentication.
api = api.Retrofit(url, auth_key, auth_pass)
# Initialize the API client with the URL, authentication key, and password
if __name__ == "__main__":
# Standard Python entry point, ensuring code runs only when the script is executed directly.
    file_path = "your_file"
# Path to your input file (image or video) that will be processed by the API.
    data = api.image_data(file_path, save=True)
# Processes the file and saves the output if save=True.

Returned Data Example

The API will return a JSON object containing the detected class names and the result data for each processed frame. If the save parameter is set to true, the response will also include the rendered image data in base64 format.

                
                    [
     {'cls':
        {'0': 'defect_class_name', '1': 'defect_class_name', '2': 'defect_class_name', '3': 'defect_class_name', ...},
     'data': [
            {'box_xyxy': [x, y, x, y],
             'box_cls': 2,
             'box_conf': 0.851271390914917}
             ]
     },
     {'cls':
        {'0': 'rating_class_name', '1': 'rating_class_name', '2': 'rating_class_name', '3': 'rating_class_name', ...},
     'data': [
            {'box_xyxy': [x, y, x, y],
             'box_cls': 2,
             'box_conf': 0.851271390914917}
             ]
     },
]

As for the video, the JSON data will be structured as a list, where each item in the list represents a frame's data, ordered serially by frame.

Errors

The Construction Defect and Rating Detection API uses the following error codes:

Error Code Meaning
E000 Missing required parameters. This error occurs when one or more mandatory parameters are not provided in the request.
E001 Invalid or unknown auth_key. This error indicates that the provided API key is invalid or expired.
E002 Invalid auth_key for this domain. This error occurs when an API key that is not authorized for the current domain is used.
E003 Invalid or unknown auth_pass. This error occurs when the provided API password is incorrect or expired.
E004 Unsupported file type. This error appears when the uploaded file is not a valid video or image format.
E005 Processing error. This error occurs when the API encounters an issue while processing the file, such as format incompatibility or server issues.