This project is aimed to caption the images which is passed to this model.
v1.0
Using Colab
!git clone https://github.com/HackSlashNITP/Caption-Craft
%cd Caption-Craft
!pip install -r requirements.txt
!python main.py "imagepath"
Using local environment
git clone https://github.com/HackSlashNITP/Caption-Craft
cd Caption-Craft
pip install -r requirements.txt
python flask.py
Run on Local System
git clone https://github.com/HackSlashNITP/Caption-Craftcd Caption-Craft- Make a folder named
content - Make another folder
Captionascontent/Caption - Save your images inside the
Captionfolder
File Structure(before run):
- Caption-Craft
- content
- Caption
- 1.jpg
- 2.jpg
- 3.png
- 4.png
- 5.jpeg
- Caption
- multicaption.py
- content
python multicaption.py, run this code inCaption-Craftdirectory
File Structure(after run):
- Caption-Craft
- content
- Caption
- 1.jpg
- 2.jpg
- 3.png
- 4.png
- 5.jpeg
- image_captions.csv
- Caption
- multicaption.py
- content
A .csv file will be formed which has Sl_No, Image_name and Image_caption, and a 3x3 matrix will be displayed which has at most nine images randomly selected from the folder Caption-Craft/content/Caption and displayed with their caption as labels.
To run on Google Colab
- copy the code in
multicaption.pyand run it. - Save your images inside the
Captionfolder at the base dir, which is/contentby default
folder_path = "/content/Caption"
ImageMatrix('/content/Caption', '/content/image_captions.csv')