archietram commited on
Commit
59dcabc
1 Parent(s): d46f19a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,13 +11,13 @@ learn = load_learner("export.pkl")
11
 
12
 
13
  def classify_image(img):
14
- tst_dl = learn.dls.test_dl(img, num_workers = 0)
15
  preds,_ = learn.get_preds(dl=tst_dl)
16
  result_text = "This person is " + str(round(preds[0][0].item(), 0)) + " years old with a BMI of " + str(round(preds[0][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.'
23
  article = "Author: <a href=\"https://huggingface.co/archietram\">Archie Tram</a>. "
 
11
 
12
 
13
  def classify_image(img):
14
+ tst_dl = learn.dls.test_dl([img], num_workers = 0)
15
  preds,_ = learn.get_preds(dl=tst_dl)
16
  result_text = "This person is " + str(round(preds[0][0].item(), 0)) + " years old with a BMI of " + str(round(preds[0][1].item(), 1)) + " kg/m^2"
17
  return result_text
18
 
19
  image = gr.inputs.Image()
20
+ examples = ['A00147.png','A00360.png','A00360.png','A01681.png','R79591.png','R86556.png','Y15554.png']
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.'
23
  article = "Author: <a href=\"https://huggingface.co/archietram\">Archie Tram</a>. "