omarhkh commited on
Commit
9fe6ece
1 Parent(s): 7f71b90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -140,22 +140,19 @@ def tott(model_name,url_input,image_input,threshold,type2):
140
  keep = processed_outputs["scores"] > threshold
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"
157
  else:
158
- return "The photo is NOT ACCEPTED"
159
 
160
 
161
  def set_example_image(example: list) -> dict:
 
140
  keep = processed_outputs["scores"] > threshold
141
  det_lab = processed_outputs["labels"][keep].tolist()
142
  xxresult=0
143
+ if det_lab.count(1) == 0:
 
144
  xxresult=1
145
+ if det_lab.count(4) == 0:
 
146
  if type2=="Trench Depth Measurement":
147
  xxresult=1
148
+ if det_lab.count(5) == 0:
 
149
  if type2=="Trench Width Measurement":
150
  xxresult=1
151
 
152
  if xxresult==0:
153
+ return """<h1 id="title">The photo is ACCEPTED</h1>"""
154
  else:
155
+ return """<h1 id="title">The photo is NOT ACCEPTED</h1>"""
156
 
157
 
158
  def set_example_image(example: list) -> dict: