File size: 409 Bytes
28f3c74
1785d30
28f3c74
 
 
1785d30
e94fae2
1785d30
28f3c74
 
 
 
e94fae2
28f3c74
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
import time
from detector import bat_detector

def find_bats(input_img):
    start = time.time()
    after_image, total_bats = bat_detector(input_img)
    return f"{total_bats}" + " bats found in " + f"{time.time()-start:.2f}s", after_image

iface = gr.Interface(
    fn=find_bats, 
    inputs=gr.Image(shape=(640, 512)), 
    outputs=['text', gr.Image(shape=(960, 768))]
)

iface.launch()