vapit commited on
Commit
4e3e7f6
·
1 Parent(s): b088e36

fix the import names and the name of the variables in list comprehension

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,5 +1,5 @@
1
  ### 1. Imports and class names setup ###
2
- from model import create_vit_model
3
 
4
  import torch
5
  from typing import Tuple, Dict
@@ -9,11 +9,11 @@ import os
9
 
10
  # Open Food101 class names file and read each line into a list
11
  with open('class_names.txt', 'r') as f:
12
- class_names = [food.strip() for food in food101_class_names]
13
 
14
 
15
- ### 2. Model and transforms perparation ###
16
- model, model_transforms = create_vitB16_model(num_classes=len(class_names))
17
 
18
  # Load save weights
19
  model.load_state_dict(torch.load(f='09_pretrained_vit_feature_extractor_food101_20_percent.pth',
 
1
  ### 1. Imports and class names setup ###
2
+ from model import create_vitB16_model
3
 
4
  import torch
5
  from typing import Tuple, Dict
 
9
 
10
  # Open Food101 class names file and read each line into a list
11
  with open('class_names.txt', 'r') as f:
12
+ class_names = [food.strip() for food in f.readlines()]
13
 
14
 
15
+ ### 2. Model and transforms preparation ###
16
+ model, model_transforms = create_vitB16_model(num_classes=101)
17
 
18
  # Load save weights
19
  model.load_state_dict(torch.load(f='09_pretrained_vit_feature_extractor_food101_20_percent.pth',