Dimitre commited on
Commit
24dd4eb
·
1 Parent(s): 38e25a7

Post process debug

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -24,15 +24,19 @@ def postprocess(prediction):
24
 
25
  def predict_fn(image):
26
  image = preprocess(image)
27
- prediction = model(image)
28
  print('****************')
29
  print(prediction)
 
 
 
 
30
  print('****************')
31
- print(prediction[0])
32
- print('****************')
33
- print(prediction[0].numpy())
34
- print('****************')
35
- print(prediction.numpy())
36
  scores = postprocess(prediction)
37
  return scores
38
 
 
24
 
25
  def predict_fn(image):
26
  image = preprocess(image)
27
+ prediction = model(image)[0].numpy()
28
  print('****************')
29
  print(prediction)
30
+ try:
31
+ print({labels[i]: prediction[i] for i in range(len(labels))})
32
+ except:
33
+ print("default gives error")
34
  print('****************')
35
+ print(list(prediction))
36
+ try:
37
+ print({labels[i]: list(prediction)[i] for i in range(len(labels))})
38
+ except:
39
+ print("list gives error")
40
  scores = postprocess(prediction)
41
  return scores
42