Push model using huggingface_hub.
Browse filesFiles changed (3)
- README.md+6-64
- config.jsonAdded+12
- model.safetensorsAdded+3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768---language:- enmetrics:- bleu- meteorbase_model:- openai-community/gpt2- google/vit-base-patch16-224tags:- image captioing- vit- gpt- gpt2- torchdatasets:- nlphuji/flickr30k---# Image Captioning using ViT and GPT2 architectureThis is my attempt to make a transformer model which takes image as the input and provides a caption for the image## Model ArchitectureIt comprises of 12 ViT encoder and 12 GPT2 decoders## TrainingThe model was trained on the dataset Flickr30k which comprises of 30k images and 5 captions for each imageThe model was trained for 8 epochs (which took 10hrs on kaggle's P100 GPU)## ResultsThe model acieved a BLEU-4 score of 0.2115, CIDEr score of 0.4, METEOR score of 0.25, and SPICE score of 0.19 on the Flickr8k datasetThese are the loss curves.## PredictionsTo predict your own images download the models.py, predict.py and the requirements.txt and then run the following commands->`pip install -r requirements.txt``python predict.py`*Predicting for the first time will take time as it has to download the model weights (1GB)*Here are a few examples of the prediction done on the Validation datasetAs we can see these are not the most amazing predictions. The performance could be improved by training it further and using an even bigger dataset like MS COCO (500k captioned images)## FAQCheck the [full notebook](./imagecaptioning.ipynb) or [Kaggle](https://www.kaggle.com/code/ayushman72/imagecaptioning)Download the [weights](https://drive.google.com/file/d/1X51wAI7Bsnrhd2Pa4WUoHIXvvhIcRH7Y/view?usp=drive_link) of the model12345678910---pipeline_tag: text-to-imagetags:- model_hub_mixin- pytorch_model_hub_mixin---This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:- Library: https://huggingface.co/ayushman72/ImageCaptioning- Docs: [More Information Needed]
123456789101112{ "attention_dropout": 0.1, "depth": 12, "emb_dropout": 0.1, "embed_dim": 768, "mlp_dropout": 0.1, "mlp_ratio": 4, "num_heads": 12, "residual_dropout": 0.1, "seq_len": 1024, "vocab_size": 50257}123version https://git-lfs.github.com/spec/v1oid sha256:dfe0f8b507dd74c679453125c45fd63dd5fb4c2d563f374b603dd6d6939b9a4csize 1004789512README.md+6-64
config.jsonAdded+12
model.safetensorsAdded+3