Vineedhar commited on
Commit
abb44cc
1 Parent(s): b0c1ce4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -9
app.py CHANGED
@@ -68,14 +68,21 @@ def infer(model, in_pil_img):
68
  return output_pil_img
69
 
70
 
71
- with gr.Blocks(title="DETR Object Detection - ClassCat",
72
- css=".gradio-container {background:lightyellow;}"
73
- ) as demo:
74
- #sample_index = gr.State([])
75
-
76
- gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">DETR Object Detection</div>""")
77
-
78
- gr.HTML("""<h4 style="color:navy;">1. Select a model.</h4>""")
 
 
 
 
 
 
 
79
 
80
  model = gr.Radio(["detr-resnet-50", "detr-resnet-101"], value="detr-resnet-50", label="Model name")
81
 
@@ -87,7 +94,8 @@ with gr.Blocks(title="DETR Object Detection - ClassCat",
87
  input_image = gr.Image(label="Input image", type="pil")
88
  output_image = gr.Image(label="Output image with predicted instances", type="pil")
89
 
90
- gr.Examples(['samples/cats.jpg', 'samples/detectron2.png', 'samples/cat.jpg', 'samples/hotdog.jpg'], inputs=input_image)
 
91
 
92
  gr.HTML("""<br/>""")
93
  gr.HTML("""<h4 style="color:navy;">3. Then, click "Infer" button to predict object instances. It will take about 10 seconds (on cpu)</h4>""")
 
68
  return output_pil_img
69
 
70
 
71
+ with gr.Blocks(title="DETR Object Detection by orYx Models") as demo:
72
+ gr.HTML("""
73
+ <style>
74
+ .logo {
75
+ position: absolute;
76
+ top: 10px;
77
+ right: 10px;
78
+ width: 100px; /* Adjust the width of the logo as needed */
79
+ height: auto;
80
+ }
81
+ </style>
82
+ <div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">DETR Object Detection</div>
83
+ <img class="logo" src="https://huggingface.co/spaces/orYx-models/object-detection-facebook-ResNets/blob/main/oryx_logo%20(2).png" alt="Logo">
84
+ <h4 style="color:navy;">1. Select a model.</h4>
85
+ """)
86
 
87
  model = gr.Radio(["detr-resnet-50", "detr-resnet-101"], value="detr-resnet-50", label="Model name")
88
 
 
94
  input_image = gr.Image(label="Input image", type="pil")
95
  output_image = gr.Image(label="Output image with predicted instances", type="pil")
96
 
97
+ gr.Examples(['https://huggingface.co/spaces/orYx-models/object-detection-facebook-ResNets/blob/main/traffic.jpg',
98
+ 'https://huggingface.co/spaces/orYx-models/object-detection-facebook-ResNets/blob/main/flyover.jpg'], inputs=input_image)
99
 
100
  gr.HTML("""<br/>""")
101
  gr.HTML("""<h4 style="color:navy;">3. Then, click "Infer" button to predict object instances. It will take about 10 seconds (on cpu)</h4>""")