ongkn commited on
Commit
320cce2
1 Parent(s): 124555d

minor issue fix

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -53,14 +53,14 @@ def classify_image(input):
53
  input_tensor=tensorResized,
54
  input_image=faceResized,
55
  reshape_transform=gradCam.reshape_transform_vit_huggingface)
56
- if result[0]["label"] == "pos" and result[0]["score"] > 0.85 and result[0]["score"] < 0.9:
57
- return result[0]["label"], result[0]["score"], str("Nice!"), face, dffImage, gradCamImage
58
- elif result[0]["label"] == "pos" and result[0]["score"] > 0.9 and result[0]["score"] < 0.95:
59
- return result[0]["label"], result[0]["score"], str("Pretty!"), face, dffImage, gradCamImage
60
- elif result[0]["label"] == "pos" and result[0]["score"] > 0.95 and result[0]["score"] < 0.99:
61
- return result[0]["label"], result[0]["score"], str("WHOA!!!!"), face, dffImage, gradCamImage
62
  elif result[0]["label"] == "pos" and result[0]["score"] > 0.99:
63
- return result[0]["label"], result[0]["score"], str("**ABSOLUTELY MINDBLOWING**"), face, dffImage, gradCamImage
64
  else:
65
  return cls, result[0]["score"], "Indifferent", face, dffImage, gradCamImage
66
 
 
53
  input_tensor=tensorResized,
54
  input_image=faceResized,
55
  reshape_transform=gradCam.reshape_transform_vit_huggingface)
56
+ if result[0]["label"] == "pos" and result[0]["score"] > 0.85 and result[0]["score"] <= 0.9:
57
+ return result[0]["label"], result[0]["score"], "Nice!", face, dffImage, gradCamImage
58
+ elif result[0]["label"] == "pos" and result[0]["score"] > 0.9 and result[0]["score"] <= 0.95:
59
+ return result[0]["label"], result[0]["score"], "Pretty!", face, dffImage, gradCamImage
60
+ elif result[0]["label"] == "pos" and result[0]["score"] > 0.95 and result[0]["score"] <= 0.99:
61
+ return result[0]["label"], result[0]["score"], "WHOA!!!!", face, dffImage, gradCamImage
62
  elif result[0]["label"] == "pos" and result[0]["score"] > 0.99:
63
+ return result[0]["label"], result[0]["score"], "**ABSOLUTELY MINDBLOWING**", face, dffImage, gradCamImage
64
  else:
65
  return cls, result[0]["score"], "Indifferent", face, dffImage, gradCamImage
66