ComputerVision / app.py
pirahansiah's picture
add YOLO
317aea0
raw
history blame
No virus
2.34 kB
'''
Sometimes you just want to take an image from your database and see how it changes by running different image processing functions, to find the best starting point for your computer vision application. In this Hugging Face space, I have included various pattern recognition functions that can easily be applied to your input images, so you can see the output of each function. I will continue to update this space with additional modes, methods, and deep learning frameworks/models, to make them easy to use for demonstration purposes. Please let me know if you would like me to include any other specific functionality.
'''
import gradio as gr
from src.threshold_methods import threshold_methods
from src.yolo import yolo
import cv2
new_outputs = [
gr.outputs.Image(type="numpy", label="Output Image"),
gr.outputs.Textbox(type="text", label="My HuggingFace URL"),
gr.outputs.Textbox(type="text", label="My linkedin URL"),
gr.outputs.Textbox(type="text", label="info")
]
def show_image():
img = cv2.imread('files/huggingface.png')
text1 = 'https://huggingface.co/spaces/pirahansiah/ComputerVision'
text2 = 'https://www.linkedin.com/in/pirahansiah/'
text3 = ' Sometimes you just want to take an image from your database and see how it changes by running different image processing functions, to find the best starting point for your computer vision application. In this Hugging Face space, I have included various pattern recognition functions that can easily be applied to your input images, so you can see the output of each function. I will continue to update this space with additional modes, methods, and deep learning frameworks/models, to make them easy to use for demonstration purposes. Please let me know if you would like me to include any other specific functionality. '
return img,text1,text2,text3
HuggingFace = gr.Interface(
fn=show_image,
live=True,
inputs=[],
outputs=new_outputs,
hide_controls=True,
hide_inputs=True,
show_submit_buttom=False,
show_clear=False,
show_generate=False,
allow_flagging=False,
title="Computer Vision and Deep Learning by Farshid PirahanSiah",
)
gr.TabbedInterface(
[HuggingFace,threshold_methods,yolo],
tab_names=['HuggingFace','Thresholding Image Segmentation','YOLO']
).queue().launch()