Spaces:
Build error
Build error
pirahansiah
commited on
Commit
•
96fc372
1
Parent(s):
3d4f485
update code
Browse files
app.py
CHANGED
@@ -1,26 +1,22 @@
|
|
1 |
-
'''
|
2 |
-
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.
|
3 |
-
|
4 |
-
'''
|
5 |
-
|
6 |
import gradio as gr
|
7 |
-
from
|
8 |
from src.yolo import yolo
|
9 |
from src.video_processing import video_processing
|
10 |
import cv2
|
11 |
|
12 |
new_outputs = [
|
13 |
-
gr.outputs.Image(type="numpy", label="Output Image"),
|
14 |
-
gr.outputs.Textbox(type="text", label="
|
15 |
-
gr.outputs.Textbox(type="text", label="
|
16 |
-
gr.outputs.Textbox(type="text", label="
|
17 |
]
|
|
|
18 |
def show_image():
|
19 |
img = cv2.imread('files/huggingface.png')
|
20 |
text1 = 'https://huggingface.co/spaces/pirahansiah/ComputerVision'
|
21 |
text2 = 'https://www.linkedin.com/in/pirahansiah/'
|
22 |
-
text3 = '
|
23 |
-
return img,text1,text2,text3
|
24 |
|
25 |
HuggingFace = gr.Interface(
|
26 |
fn=show_image,
|
@@ -28,16 +24,10 @@ HuggingFace = gr.Interface(
|
|
28 |
inputs=[],
|
29 |
outputs=new_outputs,
|
30 |
hide_controls=True,
|
31 |
-
hide_inputs=True,
|
32 |
-
show_submit_buttom=False,
|
33 |
-
show_clear=False,
|
34 |
-
show_generate=False,
|
35 |
-
allow_flagging=False,
|
36 |
title="Computer Vision and Deep Learning by Farshid PirahanSiah",
|
37 |
)
|
38 |
|
39 |
gr.TabbedInterface(
|
40 |
-
[HuggingFace,threshold_methods,yolo,video_processing],
|
41 |
-
tab_names=['HuggingFace','Thresholding Image Segmentation','YOLO','Video Multi
|
42 |
).queue().launch()
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from src.threshold_methods import threshold_methods
|
3 |
from src.yolo import yolo
|
4 |
from src.video_processing import video_processing
|
5 |
import cv2
|
6 |
|
7 |
new_outputs = [
|
8 |
+
gr.outputs.Image(type="numpy", label="Output Image"),
|
9 |
+
gr.outputs.Textbox(type="text", label="HuggingFace URL"),
|
10 |
+
gr.outputs.Textbox(type="text", label="LinkedIn URL"),
|
11 |
+
gr.outputs.Textbox(type="text", label="Info")
|
12 |
]
|
13 |
+
|
14 |
def show_image():
|
15 |
img = cv2.imread('files/huggingface.png')
|
16 |
text1 = 'https://huggingface.co/spaces/pirahansiah/ComputerVision'
|
17 |
text2 = 'https://www.linkedin.com/in/pirahansiah/'
|
18 |
+
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.'
|
19 |
+
return img, text1, text2, text3
|
20 |
|
21 |
HuggingFace = gr.Interface(
|
22 |
fn=show_image,
|
|
|
24 |
inputs=[],
|
25 |
outputs=new_outputs,
|
26 |
hide_controls=True,
|
|
|
|
|
|
|
|
|
|
|
27 |
title="Computer Vision and Deep Learning by Farshid PirahanSiah",
|
28 |
)
|
29 |
|
30 |
gr.TabbedInterface(
|
31 |
+
[HuggingFace, threshold_methods, yolo, video_processing],
|
32 |
+
tab_names=['HuggingFace', 'Thresholding Image Segmentation', 'YOLO', 'Video Multi-Object Tracking']
|
33 |
).queue().launch()
|
|