medical
Haroon commited on
Commit
c3a1ea9
1 Parent(s): 8b332db

Update example.py

Browse files

For zero shot classification, model needs to be in eval mode. Otherwise, the prediction probabilities will not be repeatable for the same image across multiple runs.

Files changed (1) hide show
  1. example.py +2 -0
example.py CHANGED
@@ -15,6 +15,8 @@ def read_image(image_path):
15
 
16
  # Load model
17
  classifier.load_model()
 
 
18
 
19
  import urllib.request
20
 
 
15
 
16
  # Load model
17
  classifier.load_model()
18
+ # Set model into eval mode
19
+ classifier.model.eval()
20
 
21
  import urllib.request
22