File size: 1,685 Bytes
9fcf801
96fc372
317aea0
ce3199d
9fcf801
 
598166e
96fc372
 
 
 
9fcf801
96fc372
598166e
317aea0
39a07f8
 
96fc372
 
598166e
 
 
 
 
 
 
6700e87
9fcf801
 
6f3703b
96fc372
 
598166e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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()