mayhug commited on
Commit
27295df
·
1 Parent(s): 186afd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -35,8 +35,11 @@ def predict(img, hide: float):
35
  img = tf.image.per_image_standardization(img)
36
  data = tf.expand_dims(img, 0)
37
  out, *_ = model(data)
38
- labels = {tag: float(out[i].numpy()) for i, tag in enumerate(tags)}
39
- return {k: v for k, v in labels.items() if v >= hide}
 
 
 
40
 
41
 
42
  image = inputs.Image(label="Upload your image here!")
 
35
  img = tf.image.per_image_standardization(img)
36
  data = tf.expand_dims(img, 0)
37
  out, *_ = model(data)
38
+ return {
39
+ tag: confidence
40
+ for i, tag in enumerate(tags)
41
+ if (confidence := float(out[i].numpy())) >= hide
42
+ }
43
 
44
 
45
  image = inputs.Image(label="Upload your image here!")