Spaces:
Build error
Build error
archietram
commited on
Commit
·
9fc4843
1
Parent(s):
bb9ed36
update app.py
Browse files- app.py +2 -2
- flagged/img/0.jpg +0 -0
- flagged/img/1.jpg +0 -0
- flagged/log.csv +3 -0
app.py
CHANGED
@@ -11,9 +11,9 @@ learn = load_learner("export.pkl")
|
|
11 |
|
12 |
|
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[
|
17 |
return result_text
|
18 |
|
19 |
image = gr.inputs.Image()
|
|
|
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()
|
flagged/img/0.jpg
ADDED
flagged/img/1.jpg
ADDED
flagged/log.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
'img','output','flag','username','timestamp'
|
2 |
+
'img/0.jpg','This person is 39.0 years old with a BMI of 28.2 kg/m^2','','','2022-10-17 13:32:51.688838'
|
3 |
+
'img/1.jpg','This person is 39.0 years old with a BMI of 28.2 kg/m^2','','','2022-10-17 13:32:53.667449'
|