File size: 1,543 Bytes
347886f 541b73b 918e641 541b73b 347886f 0ec63df 347886f 5930712 347886f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import cv2
import gradio as gr
from ultralytics import YOLO
from PIL import Image
model = YOLO('wind_turbine_anomaly_detector.pt')
def detect_turbine_anomaly(image):
result = model(image)
for r in result:
im_array = r.plot()
# im = Image.fromarray(im_array[..., ::-1])
return Image.fromarray(im_array[..., ::-1])
description = """
<center><img src="https://huggingface.co/spaces/intelliarts/hotspot-anomaly-detection-for-solar-panels/resolve/main/images/ia_logo.png" width=270px> </center><br>
<p style="font-size: 20px; text-align: center;"">This is a demo of a computer vision model by Intelliarts. It's designed to detect visible damages in turbine blades. The model operates on regular images of wind turbine blades. It indicates the damaged area, outlines it, and shows the approximate accuracy of damage detection. You can use your own regular images for testing or utilize samples from our dataset. This demo is not a finished ML solution but rather a proof of concept. It can be extended to detect other types or visible damages in wind turbines.</p>
"""
demo = gr.Interface(fn=detect_turbine_anomaly, inputs=gr.Image(type='pil'), outputs="image",
examples=[['images/test_image_1.png'], ['images/test_image_2.png'],
['images/test_image_3.png'], ['images/test_image_4.png']],
examples_per_page=4,
cache_examples= False,
description=description
)
demo.launch()
|