Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,7 +86,7 @@ def detect_objects2(model_name,url_input,image_input,threshold,type2):
|
|
| 86 |
model = DetrForObjectDetection.from_pretrained(model_name)
|
| 87 |
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
image = image_input
|
| 92 |
|
|
@@ -103,8 +103,7 @@ def detect_objects2(model_name,url_input,image_input,threshold,type2):
|
|
| 103 |
if det_lab.count(1) > 0:
|
| 104 |
total_text="Trench is Detected \n Image is Not Blurry \n"
|
| 105 |
else:
|
| 106 |
-
total_text="Trench is NOT Detected \n Image is Blurry \n"
|
| 107 |
-
global xxresult
|
| 108 |
xxresult=1
|
| 109 |
print(type2)
|
| 110 |
print(type(type2))
|
|
@@ -132,6 +131,7 @@ def tott():
|
|
| 132 |
text2 = "The photo is ACCEPTED"
|
| 133 |
else:
|
| 134 |
text2 = "The photo is NOT ACCEPTED"
|
|
|
|
| 135 |
return text2
|
| 136 |
|
| 137 |
def set_example_image(example: list) -> dict:
|
|
@@ -141,14 +141,14 @@ def set_example_url(example: list) -> dict:
|
|
| 141 |
return gr.Textbox.update(value=example[0])
|
| 142 |
|
| 143 |
|
| 144 |
-
title = """<h1 id="title">Object Detection App
|
| 145 |
|
| 146 |
description = """
|
| 147 |
-
|
| 148 |
-
-
|
| 149 |
-
-
|
| 150 |
-
-
|
| 151 |
-
-
|
| 152 |
"""
|
| 153 |
|
| 154 |
models = ["omarhkh/detr-finetuned-omar8"]
|
|
|
|
| 86 |
model = DetrForObjectDetection.from_pretrained(model_name)
|
| 87 |
|
| 88 |
|
| 89 |
+
global xxresult
|
| 90 |
|
| 91 |
image = image_input
|
| 92 |
|
|
|
|
| 103 |
if det_lab.count(1) > 0:
|
| 104 |
total_text="Trench is Detected \n Image is Not Blurry \n"
|
| 105 |
else:
|
| 106 |
+
total_text="Trench is NOT Detected \n Image is Blurry \n"
|
|
|
|
| 107 |
xxresult=1
|
| 108 |
print(type2)
|
| 109 |
print(type(type2))
|
|
|
|
| 131 |
text2 = "The photo is ACCEPTED"
|
| 132 |
else:
|
| 133 |
text2 = "The photo is NOT ACCEPTED"
|
| 134 |
+
xxresult==0
|
| 135 |
return text2
|
| 136 |
|
| 137 |
def set_example_image(example: list) -> dict:
|
|
|
|
| 141 |
return gr.Textbox.update(value=example[0])
|
| 142 |
|
| 143 |
|
| 144 |
+
title = """<h1 id="title">Object Detection App for POC</h1>"""
|
| 145 |
|
| 146 |
description = """
|
| 147 |
+
This application will test the model for the followings:
|
| 148 |
+
- Select the model
|
| 149 |
+
- Select the type of classification
|
| 150 |
+
- Then Detect
|
| 151 |
+
- The actual Results
|
| 152 |
"""
|
| 153 |
|
| 154 |
models = ["omarhkh/detr-finetuned-omar8"]
|