archietram commited on
Commit
bb9ed36
1 Parent(s): 63a14d0

update app.py

Browse files
Files changed (3) hide show
  1. app.ipynb +0 -0
  2. app.py +1 -2
  3. export.pkl +2 -2
app.ipynb ADDED
File without changes
app.py CHANGED
@@ -13,11 +13,10 @@ learn = load_learner("export.pkl")
13
  def classify_image(img):
14
  tst_dl = learn.dls.test_dl(img)
15
  preds,_ = learn.get_preds(dl=tst_dl)
16
- result_text = "This is a picture of a " + round(preds[:,0], 0) + " person with a BMI of" + round(preds[:,1], 1) + " kg/m^2"
17
  return result_text
18
 
19
  image = gr.inputs.Image()
20
- label = gr.outputs.Label()
21
  examples = ['A00147.png','A00360.png','angela lansbury.jpg']
22
  title = 'Predict Age and Body Mass Index from a Picture'
23
  description = 'This app predicts the age and BMI of a person just from their face.'
 
13
  def classify_image(img):
14
  tst_dl = learn.dls.test_dl(img)
15
  preds,_ = learn.get_preds(dl=tst_dl)
16
+ result_text = "This person is " + str(round(preds[:,0].item(), 0)) + " years old with a BMI of " + str(round(preds[:,1].item(), 1)) + " kg/m^2"
17
  return result_text
18
 
19
  image = gr.inputs.Image()
 
20
  examples = ['A00147.png','A00360.png','angela lansbury.jpg']
21
  title = 'Predict Age and Body Mass Index from a Picture'
22
  description = 'This app predicts the age and BMI of a person just from their face.'
export.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2354d84af5c136edd5b6bd51f65d43fc36babcefdc0ebf4b167f46a11b7c4a58
3
- size 116105389
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2ade66d8725e32e86af18e53e7950b7eaec1c0fc2f93a99242fcad3ed5cd407
3
+ size 51248677