- Name: Visualization System for Image Captioning (Course Project)
- Contributors: Qi Yin, Dongzi Qu
- Instructors: Claudio Silva, Jorge Piazentin Ono, Yeuk Yin Chan
- Institute: NYU Tandon School of Engineering (Dept: Computer Science)
Little bugs:
- Please remember to input the beam size
- After mask pictures, it may take a while to generate new caption, if the caption is the old one, please click "update" again.
python3, nltk, numpy, pytorch, flask
After clone this project, please download the pretrained file and put in "CapVis/pretrained" respository:
CapVis/pretrained ____ Flickr_Data
|__ BEST_checkpoint_flickr30k_5_cap_per_img_5_min_word_freq.pth.tar
|__ WORDMAP_flickr30k_5_cap_per_img_5_min_word_freq.json
|__ All_vectors
|__ center_100
|__ ...
File link:
- Pretrained computation model:
Trained with flickr30k: "https://drive.google.com/open?id=1V2PQ7uGgEKv2Wp91p1CAoUBVivcvCLqg" (This is trained by us)
Trained with COCO: "https://drive.google.com/drive/folders/189VY65I_n4RTpQnmLGj7IzVnOF6dmePC" (This is trained by sgrvinod)
ps: The code now is using flickr30k model. If you want to use COCO model, remember to change the path in "caption.py".
python App.py
Then open "http://127.0.0.1:5000/home/" in Chrome please upload an image from image test or you can whatever image but generate a vector for it before upload it.
python caption.py --model='pretrained/BEST_checkpoint_flickr30k_5_cap_per_img_5_min_word_freq.pth.tar' --word_map='pretrained/WORDMAP_flickr30k_5_cap_per_img_5_min_word_freq.json' --beam_size=5 --img='image_for_test/test7.jpg'
python get_cap.py --model='pretrained/BEST_checkpoint_flickr30k_5_cap_per_img_5_min_word_freq.pth.tar' --word_map='pretrained/WORDMAP_flickr30k_5_cap_per_img_5_min_word_freq.json' --beam_size=5 --img='image_for_test/test4.jpg'
Static data already upload:
https://observablehq.com/@yq605879396/artsed-bubble https://observablehq.com/@yq605879396/zoomable-sunburst/2
Fetching data while the server is running:
https://observablehq.com/@yq605879396/pie-chart https://observablehq.com/@yq605879396/pie-chart/2 https://observablehq.com/@yq605879396/mona-lisa-histogram/2
https://github.com/sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning This is an outstanding implementation of "show, attend and tell" in pytorch version
https://codyhouse.co/gem/vertical-fixed-navigation-2/ we rewrite our website base on this frame