Hector Lopez commited on
Commit
3ab2a3b
·
1 Parent(s): bbce95e

Added model eval() mode

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -13,6 +13,8 @@ model = get_model('efficientDet_icevision.ckpt')
13
  print('Loading the classifier')
14
  classifier = CustomViT(target_size=7, pretrained=False)
15
  classifier.load_state_dict(torch.load('class_ViT_taco_7_class.pth', map_location='cpu'))
 
 
16
 
17
  def plot_img_no_mask(image, boxes, labels):
18
  colors = {
 
13
  print('Loading the classifier')
14
  classifier = CustomViT(target_size=7, pretrained=False)
15
  classifier.load_state_dict(torch.load('class_ViT_taco_7_class.pth', map_location='cpu'))
16
+ # Set eval mode to deactivate dropout and BN layers
17
+ classifier.eval()
18
 
19
  def plot_img_no_mask(image, boxes, labels):
20
  colors = {