Update README.md
Browse files
README.md
CHANGED
|
@@ -5,7 +5,7 @@ library_name: transformers
|
|
| 5 |
pipeline_tag: image-classification
|
| 6 |
---
|
| 7 |
|
| 8 |
-
# SwiftFormer
|
| 9 |
|
| 10 |
## Model description
|
| 11 |
|
|
@@ -28,12 +28,12 @@ SwiftFormer paper introduces a novel efficient additive attention mechanism that
|
|
| 28 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 29 |
|
| 30 |
from transformers import ViTImageProcessor
|
| 31 |
-
processor = ViTImageProcessor.from_pretrained('shehan97/swiftformer-
|
| 32 |
inputs = processor(images=image, return_tensors="pt")
|
| 33 |
|
| 34 |
|
| 35 |
from transformers.models.swiftformer import SwiftFormerForImageClassification
|
| 36 |
-
new_model = SwiftFormerForImageClassification.from_pretrained('shehan97/swiftformer-
|
| 37 |
|
| 38 |
output = new_model(inputs['pixel_values'], output_hidden_states=True)
|
| 39 |
logits = output.logits
|
|
|
|
| 5 |
pipeline_tag: image-classification
|
| 6 |
---
|
| 7 |
|
| 8 |
+
# SwiftFormer (swiftformer-s)
|
| 9 |
|
| 10 |
## Model description
|
| 11 |
|
|
|
|
| 28 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 29 |
|
| 30 |
from transformers import ViTImageProcessor
|
| 31 |
+
processor = ViTImageProcessor.from_pretrained('shehan97/swiftformer-s')
|
| 32 |
inputs = processor(images=image, return_tensors="pt")
|
| 33 |
|
| 34 |
|
| 35 |
from transformers.models.swiftformer import SwiftFormerForImageClassification
|
| 36 |
+
new_model = SwiftFormerForImageClassification.from_pretrained('shehan97/swiftformer-s')
|
| 37 |
|
| 38 |
output = new_model(inputs['pixel_values'], output_hidden_states=True)
|
| 39 |
logits = output.logits
|