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

Use a single model

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -142,20 +142,20 @@ 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.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:
156
- logger.info("old_result_probabilty < 0.06")
157
- result_probabilty = old_result_probabilty
158
- decision = "AUTO REJECT"
159
  else:
160
  decision = "MODERATION"
161
  logger.info(f"decision: {decision}")
@@ -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.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.
 
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.9:
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:
156
+ # logger.info("old_result_probabilty < 0.06")
157
+ # result_probabilty = old_result_probabilty
158
+ # decision = "AUTO REJECT"
159
  else:
160
  decision = "MODERATION"
161
  logger.info(f"decision: {decision}")
 
172
  outputs="text",
173
  description="""
174
  The model returns the probability of the image being a base body. If
175
+ probability > 0.9, the image can be automatically tagged as a base body. If
176
+ probability < 0.2, 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.