Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,16 +141,16 @@ def tott(model_name,url_input,image_input,threshold,type2):
|
|
| 141 |
det_lab = processed_outputs["labels"][keep].tolist()
|
| 142 |
xxresult=0
|
| 143 |
if det_lab.count(1) > 0:
|
| 144 |
-
|
| 145 |
-
|
| 146 |
if det_lab.count(4) > 0:
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
if det_lab.count(5) > 0:
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
if xxresult==0:
|
| 156 |
return "The photo is ACCEPTED"
|
|
@@ -168,11 +168,12 @@ def set_example_url(example: list) -> dict:
|
|
| 168 |
title = """<h1 id="title">Object Detection App for POC</h1>"""
|
| 169 |
|
| 170 |
description = """
|
| 171 |
-
This application
|
| 172 |
- Select the model
|
| 173 |
-
- Select the type of classification
|
| 174 |
-
-
|
| 175 |
-
-
|
|
|
|
| 176 |
"""
|
| 177 |
|
| 178 |
models = ["omarhkh/detr-finetuned-omar8"]
|
|
|
|
| 141 |
det_lab = processed_outputs["labels"][keep].tolist()
|
| 142 |
xxresult=0
|
| 143 |
if det_lab.count(1) > 0:
|
| 144 |
+
else:
|
| 145 |
+
xxresult=1
|
| 146 |
if det_lab.count(4) > 0:
|
| 147 |
+
else:
|
| 148 |
+
if type2=="Trench Depth Measurement":
|
| 149 |
+
xxresult=1
|
| 150 |
if det_lab.count(5) > 0:
|
| 151 |
+
else:
|
| 152 |
+
if type2=="Trench Width Measurement":
|
| 153 |
+
xxresult=1
|
| 154 |
|
| 155 |
if xxresult==0:
|
| 156 |
return "The photo is ACCEPTED"
|
|
|
|
| 168 |
title = """<h1 id="title">Object Detection App for POC</h1>"""
|
| 169 |
|
| 170 |
description = """
|
| 171 |
+
This application can be used as follows:
|
| 172 |
- Select the model
|
| 173 |
+
- Select the type of classification
|
| 174 |
+
- Select the photo
|
| 175 |
+
- Press Detect
|
| 176 |
+
- Press Results
|
| 177 |
"""
|
| 178 |
|
| 179 |
models = ["omarhkh/detr-finetuned-omar8"]
|