Update README.md
Browse files
README.md
CHANGED
@@ -5,8 +5,6 @@ language_creators:
|
|
5 |
- found
|
6 |
language:
|
7 |
- en
|
8 |
-
license:
|
9 |
-
- mit
|
10 |
multilinguality:
|
11 |
- monolingual
|
12 |
size_categories:
|
@@ -17,4 +15,21 @@ task_categories:
|
|
17 |
- image-classification
|
18 |
task_ids:
|
19 |
- multi-class-image-classification
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
- found
|
6 |
language:
|
7 |
- en
|
|
|
|
|
8 |
multilinguality:
|
9 |
- monolingual
|
10 |
size_categories:
|
|
|
15 |
- image-classification
|
16 |
task_ids:
|
17 |
- multi-class-image-classification
|
18 |
+
datasets:
|
19 |
+
- cifar10
|
20 |
+
---
|
21 |
+
## Image Classification with Vision Transformer (ViT)
|
22 |
+
This repository contains a Python script for training an image classification model using the Vision Transformer (ViT) architecture. We use the transformers and datasets libraries from Hugging Face along with PyTorch and TensorFlow for the implementation.
|
23 |
+
|
24 |
+
### Functions and Usage
|
25 |
+
* convert_to_tf_tensor(image: Image):
|
26 |
+
* This function converts an image to a Tensorflow tensor with a size of 224x224 and three color channels.
|
27 |
+
|
28 |
+
* preprocess(batch):
|
29 |
+
* Preprocesses the images in a batch, using the feature extractor to convert them to pixel values. It also adds the labels to the batch.
|
30 |
+
|
31 |
+
* collate_fn(batch):
|
32 |
+
* This function prepares the batch for training or evaluation. It stacks the pixel values and labels.
|
33 |
+
|
34 |
+
* compute_metrics(p):
|
35 |
+
* Computes the metrics (accuracy) for the predictions.
|