File size: 2,336 Bytes
39a07f8
 
 
 
 
9fcf801
317aea0
 
9fcf801
 
598166e
6700e87
39a07f8
 
 
9fcf801
598166e
317aea0
39a07f8
 
 
 
598166e
 
 
 
 
 
 
 
 
 
 
 
6700e87
9fcf801
 
6f3703b
317aea0
 
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
35
36
37
38
39
40
41
42
43
'''
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()