Spaces:
Build error
Build error
archietram
commited on
Commit
•
bb9ed36
1
Parent(s):
63a14d0
update app.py
Browse files- app.ipynb +0 -0
- app.py +1 -2
- 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
|
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:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d2ade66d8725e32e86af18e53e7950b7eaec1c0fc2f93a99242fcad3ed5cd407
|
3 |
+
size 51248677
|