File size: 1,740 Bytes
cf65075
 
51632a6
565e3f9
c963191
565e3f9
8c8b210
565e3f9
c963191
565e3f9
 
 
 
 
9899761
 
 
 
 
 
565e3f9
345eb49
c963191
 
5af822f
c963191
 
 
 
 
e2dfe53
c963191
 
51632a6
c963191
345eb49
565e3f9
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
from ImageAnnotator import image_annotate
from PoseAnnotator import pose_annotate
import gradio as gr

objectDetector = gr.Interface(
    fn = image_annotate,
    theme = "gstaff/sketch",
    title="Object Detection",
    inputs = [gr.Image(type="filepath",label="Image"), gr.Radio(label="Select Annotator",
                                                 choices=["Box","Roundbox","Boxcorner","Color","Circle","Dot","Triangle",
                                                          "Ellipse","Percentage","Heatmap","Label","Blur",
                                                          "Pixelate","Backgroundcolor"],
                                                 value = "Box")],
    outputs = gr.Image(label = "Annotated Image"),
    examples = [["cars.jpg","Box"],
                ["colorful-backgrounds-for-laptops.jpg","Roundbox"],
                ["final_animals-homeschooling_credit-alamy.jpg","Circle"],
                ["Furry.png","Pixelate"],
                ["Desktop-Wallpaper-HD4.jpeg","Label"],
                ["bowling_ball.jpg","Percentage"]]
)

poseDetector = gr.Interface(
    fn = pose_annotate,
    theme = "gstaff/sketch",
    title="Pose Detection",
    inputs = [gr.Image(type="filepath",label="Image"), gr.Radio(label="Select Annotator",
                                                 choices=["Vertex","Edge","Vertexlabel"],
                                                 value = "Vertex")],
    outputs = gr.Image(label = "Annotated Image"),
    examples = [["Pose.jpg", "Edge"],["black runner.jpg", "Vertexlabel"]]
)

app = gr.TabbedInterface([objectDetector,poseDetector],["Object Detection","Pose Detection"], theme = "gstaff/sketch")

if __name__ == "__main__":
  app.launch(mcp_server = True)