brightlembo commited on
Commit
293adc9
·
verified ·
1 Parent(s): 7a3cf1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import torch
2
- from torchvision import transforms
3
  from PIL import Image
4
  import json
5
  import streamlit as st
@@ -10,6 +10,7 @@ with open("class_names.json", "r") as f:
10
 
11
  # Charger le modèle
12
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
13
  model = torch.load("efficientnet_b7_best.pth", map_location=device)
14
  model.eval() # Mode évaluation
15
 
 
1
  import torch
2
+ from torchvision import transforms, models
3
  from PIL import Image
4
  import json
5
  import streamlit as st
 
10
 
11
  # Charger le modèle
12
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13
+ model = models.efficientnet_b7(pretrained=False)
14
  model = torch.load("efficientnet_b7_best.pth", map_location=device)
15
  model.eval() # Mode évaluation
16