Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ model = AutoModelForImageClassification.from_pretrained("saved_model_files")
|
|
8 |
labels = dataset['train'].features['labels'].names
|
9 |
|
10 |
def classify(input_image):
|
11 |
-
features =
|
12 |
logits = model(features["pixel_values"])[-1]
|
13 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
14 |
probs = probability[0].detach().numpy()
|
|
|
8 |
labels = dataset['train'].features['labels'].names
|
9 |
|
10 |
def classify(input_image):
|
11 |
+
features = extractor(input_image, return_tensors='pt')
|
12 |
logits = model(features["pixel_values"])[-1]
|
13 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
14 |
probs = probability[0].detach().numpy()
|