ComputerVision / app.py
pirahansiah's picture
update code
96fc372 verified
raw
history blame
1.69 kB
import gradio as gr
from src.threshold_methods import threshold_methods
from src.yolo import yolo
from src.video_processing import video_processing
import cv2
new_outputs = [
gr.outputs.Image(type="numpy", label="Output Image"),
gr.outputs.Textbox(type="text", label="HuggingFace URL"),
gr.outputs.Textbox(type="text", label="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 want to take an image from your database and see how it changes by applying 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 be easily applied to your input images, allowing you to 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 any other specific functionality included.'
return img, text1, text2, text3
HuggingFace = gr.Interface(
fn=show_image,
live=True,
inputs=[],
outputs=new_outputs,
hide_controls=True,
title="Computer Vision and Deep Learning by Farshid PirahanSiah",
)
gr.TabbedInterface(
[HuggingFace, threshold_methods, yolo, video_processing],
tab_names=['HuggingFace', 'Thresholding Image Segmentation', 'YOLO', 'Video Multi-Object Tracking']
).queue().launch()