hwajjala commited on
Commit
25c38db
β€’
1 Parent(s): 966e6ea

Update thresholds

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -142,14 +142,14 @@ def predict_fn(input_img):
142
  hair_result_probabilty = float(hair_probabilities[0][1].round(3))
143
  old_result_probabilty = float(old_lr_probabilities[0][1].round(3))
144
  # get decision string
145
- if result_probabilty > 0.77:
146
  if hair_result_probabilty < 0.24:
147
  logger.info("hair_result_probabilty < 0.5")
148
  result_probabilty = hair_result_probabilty
149
  decision = "AUTO REJECT"
150
  else:
151
  decision = "AUTO ACCEPT"
152
- elif result_probabilty < 0.2:
153
  logger.info("result_probabilty < 0.2")
154
  decision = "AUTO REJECT"
155
  elif old_result_probabilty < 0.06:
@@ -172,8 +172,8 @@ iface = gr.Interface(
172
  outputs="text",
173
  description="""
174
  The model returns the probability of the image being a base body. If
175
- probability > 0.77, the image can be automatically tagged as a base body. If
176
- probability < 0.24, the image can be automatically REJECTED as NOT as base
177
  body. All other cases will be submitted for moderation.
178
 
179
  Please flag if you think the decision is wrong.
 
142
  hair_result_probabilty = float(hair_probabilities[0][1].round(3))
143
  old_result_probabilty = float(old_lr_probabilities[0][1].round(3))
144
  # get decision string
145
+ if result_probabilty > 0.85:
146
  if hair_result_probabilty < 0.24:
147
  logger.info("hair_result_probabilty < 0.5")
148
  result_probabilty = hair_result_probabilty
149
  decision = "AUTO REJECT"
150
  else:
151
  decision = "AUTO ACCEPT"
152
+ elif result_probabilty < 0.24:
153
  logger.info("result_probabilty < 0.2")
154
  decision = "AUTO REJECT"
155
  elif old_result_probabilty < 0.06:
 
172
  outputs="text",
173
  description="""
174
  The model returns the probability of the image being a base body. If
175
+ probability > 0.85, the image can be automatically tagged as a base body. If
176
+ probability < 0.25, the image can be automatically REJECTED as NOT as base
177
  body. All other cases will be submitted for moderation.
178
 
179
  Please flag if you think the decision is wrong.