This repository contains the project I worked on during my internship at Somera
First clone the repository and change directory
$ git clone https://github.com/badayvedat/turkish-image-captioning.git
$ cd turkish-image-captioning
Install dependencies. Installing on an isolated environment such as venv or conda is preferred.
$ pip install -r requirements.txt
All of TasvirEt dataset used in validation. Because unlike COCO and Flickr30K captions, TasvirEt is not automatically translated, making it a better choice for validation.
Download and create dataset
$ sh data/download_data.sh
Make COCO dataset
$ python3 data/coco.py
Make Flickr30k dataset
$ python3 data/flickr30k.py
Make Flickr8k dataset
$ python3 data/flickr8k.py
Create a config file with necessary parameters.
For example config files check configs/
folder.
$ python3 train.py configs/12heads20kvoc.yaml
Run python3 train.py -h
to see all parameters.
Also, you can use train.ipynb notebook.
Download config file, pre-trained weights and vocabulary file.
$ sh download_pretrained.sh
Currently only jpg files are supported.
$ docker build -t turkish-caption .
$ docker run -p 6006:6006 turkish-caption
$ cd app
$ flask run
$ python3 evaluate.py path_to_image
Run python3 evaluate.py -h
to see all parameters.