RashiAgarwal's picture
Update app.py
5f47025
raw
history blame
1.45 kB
# Gradio app for YOLOv3
import numpy as np
import gradio as gr
from pytorch_grad_cam import GradCAM
from pytorch_grad_cam.utils.image import show_cam_on_image
from pytorch_grad_cam.utils.model_targets import ClassifierOutputTarget
from display import inference
gr.Interface(
inference,
inputs=[
gr.Image(label="Input Image"),
gr.Slider(0, 1, value=0.75, label="IOU Threshold"),
gr.Slider(0, 1, value=0.75, label="Threshold"),
],
outputs=gr.Gallery(rows=2, columns=1),
title = '''YoloV3 on PASCAL VOC Dataset From Scratch
Classes - aeroplane, bicycle, bird,
boat, bottle, bus, car, cat, chair,
cow, diningtable, dog,horse, motorbike,
person, pottedplant, sheep, sofa,train, tvmonitor
'''
,examples=[
["Examples/000001.jpg", 0.75, 0.75, True, 0.5],
["Examples/000002.jpg", 0.75, 0.75, True, 0.5],
["Examples/000003.jpg", 0.75, 0.75, True, 0.5],
["Examples/000004.jpg", 0.75, 0.75, True, 0.5],
["Examples/000005.jpg", 0.75, 0.75, True, 0.5],
["Examples/000006.jpg", 0.75, 0.75, True, 0.5],
["Examples/000007.jpg", 0.75, 0.75, True, 0.5],
["Examples/000008.jpg", 0.75, 0.75, True, 0.5],
["Examples/000009.jpg", 0.75, 0.75, True, 0.5],
["Examples/000010.jpg", 0.75, 0.75, True, 0.5]
]
,
layout="horizontal"
).launch(debug=True)