No project description provided
Project description
Visual transformer, based
You can import this module via
pip install vtransformer
How to use it?
- Configure config yaml file to work with model
- Module has 2 methods:
- run - use for training and testing model
- __call__ - use to classify images and utilize model Example of the code:
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
- Idea is based on science article An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- I have used pretrained model from SWAG, check the license
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vtransformer-0.1.0.tar.gz
(10.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vtransformer-0.1.0.tar.gz.
File metadata
- Download URL: vtransformer-0.1.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e691b238b4b8f81e1e7675884e893e3f8e691b0719c3d6a8ce1788263ea1904
|
|
| MD5 |
4df66c2532404704e154a826813b7f1f
|
|
| BLAKE2b-256 |
dc620219fa32cfb9a2fa873c99134090d0b6c9ae6d65435a4d54988f2124ea50
|
File details
Details for the file vtransformer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vtransformer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eee655d20968f75f435dcfe03df20a35b37a2f626b1d696e5677c0ba4caa5d19
|
|
| MD5 |
09c36ce4481ba3fac6a8cff3483d4266
|
|
| BLAKE2b-256 |
741a27b0f0e1de908bc7b0ea9f060bb09433f288ee0f4c11b774eda872ed13d8
|