Sign In
April 22, 2025
by Alejandro Duarte Vendries
Structural engineers typically have multiple ways to assess cracks. Traditionally, a crack width gauge is used to measure a crack’s width. It is basically a small ruler placed directly on the crack. However, using this tool is not always practical, especially when direct inspection is not possible and you only have a photo that includes a reference object with known dimensions.This becomes even harder when there are multiple cracks with different widths, making manual measurement slow and difficult. A perfect example is a tank that is difficult to access or pavement roads with numerous cracks that require assessment, making it unfeasible to rate them individually.
Additionally, each crack needs a rating. This is achieved by comparing its width against the applicable standards like ACI or Eurocode. These cracks often have varying widths, so it is also important to identify the crack width distribution along the crack, which ends up being a repetitive and boring task.
In recent years, many AI models have been developed that can help automate this process. However, engineering firms often face friction in adopting these models because they lack user-friendly interfaces. Additionally, these models run on a single computer with a GPU, holding back collaboration between colleagues.
To make these models easier to adopt in practice, the following steps can be built into an application to identify and rate concrete cracks:
Create a UI to upload the image.
Send the image to the model and visualize the AI model’s output.
Calculate the crack width distribution.
Compare the crack widths to your region's structural standards.
However, most of these steps require web development skills and knowledge of how to deploy AI models, which are not always available in engineering teams. To overcome this, we will use VIKTOR, a platform that lets you build web applications using Python. It also allows the app to connect to your computer and run AI models locally, which makes deployment easier. Keep reading to see how integrating AI models into a web application makes detecting and assessing concrete cracks an easy task, improving your efficiency and productivity.
The two core components of this workflow are the AI model and the web application. There are many AI models available for this task, as this field of research continuously evolves. For this blog, we will use one of the most popular models. YOLO, developed by Ultralytics, is a popular real-time object detection and image segmentation model. We will use a pretrained model yolov8n-seg
available here, trained on this dataset. Do not worry about installing this model yet, there is a GitHub repo waiting for you at the end of this blog!
Let’s now dive into how to integrate this into a web application!
The first step is to let our users upload images into our app. We can do this by simply adding a vkt.FileField
component to the UI. Then, users can open this field and drag and drop the image they want analyzed. After uploading, the backend reads the image and shows it back to the user using a vkt.ImageView
. This helps verify that the upload was successful.
Next, we send the image to our YOLO model using a VIKTOR Worker, a simple executable that connects our web app to our computer. The image is sent to our computer, processed by the AI model, segmented to find cracks, and measured for crack width using a method called skeletonization, which basically measures the distance between the crack center lines and its width edges using image processing. These results are then returned to the web app.
We can configure our VIKTOR Worker in two ways: using a Python Worker for smaller models (where model weights can be easily downloaded each time the worker runs) or a Generic Worker for larger models (where model weights are placed in a specific folder in your computer). Either option is straightforward to implement, since it is just an executable file that runs on our computer.
After receiving results from the Worker, we convert the crack width from pixels to millimeters. A common method involves placing an object of known size in the image to set a scale. Advanced methods exist, but this simple approach works effectively: simply divide the known dimension of the reference object by the measured pixels. With this scale factor, a single known measurement can be used to estimate the width distribution along the entire crack.
For visualization, our app uses vkt.PlotlyView
to display a nice histogram, clearly showing the distribution of crack widths.
Although AI helps measure cracks, engineers must still compare measurements against engineering standards. Our app uses standards like Eurocode, ACI, and BS for assessment. Results are displayed using vkt.TableView
, highlighted with colors: green for acceptable and red for unacceptable. Users can easily see if cracks meet standards or not.
At this step, you already uploaded and processed the image, reviewed the segmentation process, analyzed the crack distribution, and finally compared the crack width against a suitable standard. The best part? No expensive GPU was rented, the model was not deployed somewhere else, and zero lines of JavaScript or HTML were written. You can achieve all of this using simple Python knowledge!
Ready to integrate AI into your workflows? This app is open source on GitHub, allowing you to customize it easily. You can switch to a larger model, modify visualizations, add local engineering standards, or include reporting. Modifying it is as simple as building with Lego blocks!
In this blog, we covered the steps to integrate AI models like YOLO with VIKTOR, explored how a simple app can add significant value in structural inspection workflows, showcased an integration between AI and compliance with engineering codes and standards.
Adding AI to your application does not require complex infrastructure or deep machine learning expertise. With the right tools, like VIKTOR and Python, you can connect an AI model to a user-friendly interface and deploy it with minimal effort. What used to be a complex task is now something any engineer can do with a few lines of code.
Developing and deploying AI-powered web apps for structural engineering has never been easier or more enjoyable! Join the growing community of engineers automating their tasks—create your own VIKTOR account now and enhance your engineering projects!