|
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() |
|
|
|
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 wind farm management model designed to monitor the condition of wind turbines. It can be integrated into a drone surveillance system to enhance inspection processes. The model identifies obstacles such as power lines and antennas, helping to plan efficient paths for drones and preventing potential collisions. You can test the model with your own drone footage or utilize samples from our dataset.</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, |
|
|
|
) |
|
demo.launch() |
|
|