NielsRogge / Transformers-Tutorials

This repository contains demos I made with the Transformers library by HuggingFace.
MIT License
8.51k stars 1.34k forks source link

Train ViT image from scratch with custom private dataset #254

Open Alberto1404 opened 1 year ago

Alberto1404 commented 1 year ago

Hi, I have read your tutorials about ViT and finetuning on custom dataset, and based on one of your links https://blog.roboflow.com/how-to-train-vision-transformer/ this is the way to load the dataset. I was wondering if there is another way to use my custom dataset with uploading it anywhere, because it is private. If so, could you please provide a deep tutorial from how to prepare the dataset to train it, using ViT on custom dataset (without Roboflow or simmilar). The other tutorials here https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer do not use custom dataset I am new at HuggingFace, I am managing to catch up soon. Any help is appreciated. Thank you

NielsRogge commented 1 year ago

Hi,

To train ViT from scratch I'd recommend to check out the image classification script: https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification as well as the image pre-training scripts: https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining.