RyanTietjen commited on
Commit
805c2f3
·
verified ·
1 Parent(s): 41a1781

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ import torch
9
  import os
10
  import gradio as gr
11
 
12
- with open("demo/class_names.txt", 'r') as file:
13
  class_names = [line.strip() for line in file]
14
 
15
 
@@ -18,7 +18,7 @@ model, transforms = vit_b_16(num_classes=101,
18
  freeze_gradients=True,
19
  unfreeze_blocks=0)
20
 
21
- model.load_state_dict(torch.load('demo/vit_b_16_unfreeze_one_encoder_block_10_total_epochs.pth',
22
  weights_only=True))
23
 
24
 
@@ -55,7 +55,7 @@ and fine-tuning the results for specific food categories.
55
  This model achieved a Top-1 accuracy of 91.55% and a Top-5 accuracy of 98.56%
56
  """
57
 
58
- sample_list = [["demo/samples/" + sample] for sample in os.listdir("demo/samples")]
59
 
60
  #Gradio interface
61
  demo = gr.Interface(
 
9
  import os
10
  import gradio as gr
11
 
12
+ with open("class_names.txt", 'r') as file:
13
  class_names = [line.strip() for line in file]
14
 
15
 
 
18
  freeze_gradients=True,
19
  unfreeze_blocks=0)
20
 
21
+ model.load_state_dict(torch.load('vit_b_16_unfreeze_one_encoder_block_10_total_epochs.pth',
22
  weights_only=True))
23
 
24
 
 
55
  This model achieved a Top-1 accuracy of 91.55% and a Top-5 accuracy of 98.56%
56
  """
57
 
58
+ sample_list = [["samples/" + sample] for sample in os.listdir("samples")]
59
 
60
  #Gradio interface
61
  demo = gr.Interface(