Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,9 +101,10 @@ def detect_objects2(model_name,url_input,image_input,threshold,type2):
|
|
| 101 |
det_lab = processed_outputs["labels"][keep].tolist()
|
| 102 |
det_lab.count(1)
|
| 103 |
if det_lab.count(1) > 0:
|
| 104 |
-
total_text="Trench is Detected \n Not Blurry \n"
|
| 105 |
else:
|
| 106 |
-
total_text="Trench is NOT Detected \n Blurry \n"
|
|
|
|
| 107 |
xxresult=1
|
| 108 |
print(type2)
|
| 109 |
print(type(type2))
|
|
@@ -114,6 +115,7 @@ def detect_objects2(model_name,url_input,image_input,threshold,type2):
|
|
| 114 |
else:
|
| 115 |
total_text+="Measuring Tape (Vertical) for measuring Depth is NOT Detected \n"
|
| 116 |
if type2=="Trench Depth Measurement":
|
|
|
|
| 117 |
xxresult=1
|
| 118 |
|
| 119 |
if det_lab.count(5) > 0:
|
|
@@ -121,11 +123,13 @@ def detect_objects2(model_name,url_input,image_input,threshold,type2):
|
|
| 121 |
else:
|
| 122 |
total_text+="Measuring Tape (Horizontal) for measuring Width is NOT Detected \n"
|
| 123 |
if type2=="Trench Width Measurement":
|
|
|
|
| 124 |
xxresult=1
|
| 125 |
|
| 126 |
return total_text
|
| 127 |
|
| 128 |
def tott():
|
|
|
|
| 129 |
if xxresult==0:
|
| 130 |
text2 = "The photo is ACCEPTED"
|
| 131 |
else:
|
|
|
|
| 101 |
det_lab = processed_outputs["labels"][keep].tolist()
|
| 102 |
det_lab.count(1)
|
| 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))
|
|
|
|
| 115 |
else:
|
| 116 |
total_text+="Measuring Tape (Vertical) for measuring Depth is NOT Detected \n"
|
| 117 |
if type2=="Trench Depth Measurement":
|
| 118 |
+
global xxresult
|
| 119 |
xxresult=1
|
| 120 |
|
| 121 |
if det_lab.count(5) > 0:
|
|
|
|
| 123 |
else:
|
| 124 |
total_text+="Measuring Tape (Horizontal) for measuring Width is NOT Detected \n"
|
| 125 |
if type2=="Trench Width Measurement":
|
| 126 |
+
global xxresult
|
| 127 |
xxresult=1
|
| 128 |
|
| 129 |
return total_text
|
| 130 |
|
| 131 |
def tott():
|
| 132 |
+
global xxresult
|
| 133 |
if xxresult==0:
|
| 134 |
text2 = "The photo is ACCEPTED"
|
| 135 |
else:
|