CullerWhale commited on
Commit
521d81d
·
verified ·
1 Parent(s): 47634f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -37,23 +37,23 @@ print("Model Vocabulary:", learn.dls.vocab)
37
 
38
  labels = learn.dls.vocab
39
 
40
- # def predict(img):
41
- # img = PILImage.create(img)
42
- # pred,pred_idx,probs = learn.predict(img)
43
- # return {labels[i]: float(probs[i]) for i in range(len(labels))}
44
 
45
 
46
 
47
- def predict(img):
48
- img = PILImage.create(img)
49
- pred, pred_idx, probs = learn.predict(img)
50
- results = {labels[i]: float(probs[i]) for i in range(len(labels))}
51
- # Adjust results to highlight when 'Survived' meets the 75% threshold
52
- if results['Survived'] <= 0.1:
53
- results['Survived'] = 1.0 # Indicating high confidence of survival
54
- else:
55
- results['Survived'] = 0.0 # Indicating it did not meet the threshold
56
- return results
57
 
58
 
59
  # def predict(img):
 
37
 
38
  labels = learn.dls.vocab
39
 
40
+ def predict(img):
41
+ img = PILImage.create(img)
42
+ pred,pred_idx,probs = learn.predict(img)
43
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
44
 
45
 
46
 
47
+ # def predict(img):
48
+ # img = PILImage.create(img)
49
+ # pred, pred_idx, probs = learn.predict(img)
50
+ # results = {labels[i]: float(probs[i]) for i in range(len(labels))}
51
+ # # Adjust results to highlight when 'Survived' meets the 75% threshold
52
+ # if results['Survived'] <= 0.1:
53
+ # results['Survived'] = 1.0 # Indicating high confidence of survival
54
+ # else:
55
+ # results['Survived'] = 0.0 # Indicating it did not meet the threshold
56
+ # return results
57
 
58
 
59
  # def predict(img):