update usage
Browse files
README.md
CHANGED
@@ -100,11 +100,13 @@ import torch
|
|
100 |
processor = AutoImageProcessor.from_pretrained("kubinooo/convnext-tiny-224-audio-deepfake-classification")
|
101 |
model = AutoModelForImageClassification.from_pretrained("kubinooo/convnext-tiny-224-audio-deepfake-classification")
|
102 |
|
103 |
-
image = Image.open("
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
108 |
```
|
109 |
|
110 |
### Downstream Use
|
|
|
100 |
processor = AutoImageProcessor.from_pretrained("kubinooo/convnext-tiny-224-audio-deepfake-classification")
|
101 |
model = AutoModelForImageClassification.from_pretrained("kubinooo/convnext-tiny-224-audio-deepfake-classification")
|
102 |
|
103 |
+
image = Image.open("/path/to/your/image").convert("RGB")
|
104 |
+
pixel_values = processor(image, return_tensors="pt").pixel_values
|
105 |
+
with torch.no_grad():
|
106 |
+
outputs = model(pixel_values)
|
107 |
+
logits = outputs.logits
|
108 |
+
predicted_class_idx = logits.argmax(-1).item()
|
109 |
+
print(model.config.id2label[predicted_class_idx])
|
110 |
```
|
111 |
|
112 |
### Downstream Use
|