Lien5757 commited on
Commit
7384ab4
1 Parent(s): a40d9e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -1,8 +1,6 @@
1
- # Load model directly
2
- from transformers import AutoImageProcessor, AutoModelForImageClassification
3
 
4
- processor = AutoImageProcessor.from_pretrained("microsoft/resnet-18")
5
- model = AutoModelForImageClassification.from_pretrained("microsoft/resnet-18")
6
 
7
  import requests # 用於發送 HTTP 請求
8
  from PIL import Image
 
1
+ import torch
 
2
 
3
+ model = torch.hub.load('pytorch/vision:v0.6.0', 'resnet18', pretrained=True).eval() # evaluation
 
4
 
5
  import requests # 用於發送 HTTP 請求
6
  from PIL import Image