Metadata-Version: 2.1
Name: vtransformer
Version: 0.1.0
Summary: 
Author: Sashavav
Author-email: vav110011@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: einops (>=0.8.0,<0.9.0)
Requires-Dist: hydra-core (>=1.3.2,<2.0.0)
Requires-Dist: pre-commit (>=4.0.1,<5.0.0)
Requires-Dist: torch (>=2.5.1,<3.0.0)
Requires-Dist: torchsummary (>=1.5.1,<2.0.0)
Requires-Dist: torchvision (>=0.20.1,<0.21.0)
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
Description-Content-Type: text/markdown

# Visual transformer, based 
***
## You can import this module via
```shell
pip install vtransformer
```
## How to use it?
1. Configure config yaml file to work with model
2. Module has 2 methods:
   1. run - use for training and testing model
   2. \_\_call__ - use to classify images and utilize model
Example of the code:

```python
import VisionTransformer as ViT
import hydra
from pathlib import Path


@hydra.main(config_path="path_to_your_config", config_name="name_of_your_config")
def main(cfg):
   abspath = str(Path(__file__).parent.resolve()) + "/"  # Get absolute path, if your config works with relative paths
   model = ViT.Program(cfg, abspath)  # Create object of class Program to work with transformer

   model.run()  # Run config, that you wrote to train and test model

   arr = ["path1", "path2", "path3"]
   print(model(arr, False))  # Utilize model


if __name__ == "__main__":
   main()
```
***
## Credits
Thanks for the idea and pretrained models to:
- A huge credit to my teacher, [Alexandr Korchemnyj](https://github.com/Yessense)
- Idea is based on science article
[An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929)
- I have used pretrained model from SWAG, [check the license](https://github.com/facebookresearch/SWAG/blob/main/LICENSE)

