Views
No views yet
$ git clone https://github.com/Aman-4-Real/MMTG.git
$ cd MMTG/
$ conda create -n mmtg python=3.7
$ conda activate mmtg$ conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge
$ pip install -r requirements.txt| FileName | Description | Path |
|---|---|---|
| *_data_*.pkl | Train, validation, and test data. | sharing_link/data/ |
| mmtg_ckpt.pth | The checkpoint of MMTG for your reproduction. | sharing_link/ckpts/ |
| GPT2_lyrics_ckpt_epoch00.ckpt | The pre-trained decoder checkpoint. It is based on GPT2 and trained on lyrics corpus. | sharing_link/ckpts/ |
| token_id2emb_dict.pkl | The dict file of each token in vocabulary to WenLan embeddings. | sharing_link/ |
.pkl files are in list type and each item of them is in the following format:{
'topic': STRING # the topic words
'topic_emb': LIST # embs of the topic words
'lyrics': LIST # list of lyrics sentences
'img_0_emb': LIST # emb of the 1st image
'r_0': STRING # the 1st text
'r_0_emb': LIST # emb of the 1st text
'img_1_emb': LIST # emb of the 2nd image
'r_1': STRING # the 2nd text
'r_1_emb': LIST # emb of the 2nd text
...,
'img_4_emb': LIST # emb of the 4th image
'r_4': STRING # the 4th text
'r_4_emb': LIST # emb of the 4th text
'rating': INT # the sample level (range from 1 to 5, 5 refers to the most positive one while 1 refers to the least).
}{
'score_0': {
'img_rel': [2, 2], # the relevance score of the 1st image and the 1st & 2nd lyrics sentences (range from 1 to 5).
'r_rel': [1, 1], # the relevence score of the 1st text and the 1st & 2nd lyrics sentences (range from 1 to 5).
'cmp_rel': [0, 0] # whether the image or the text is more relevant to the lyrics. 0 refers to the image and 2 refers to the text (1 means a tie).
} # a list above means: [rator1_score, rator2_score]
...,
'score_4': ...
}mmtg_ckpt.pth: The checkpoint of MMTG for your reproduction. It is trained on the dataset we released. You can simply load it and use it to generate on your own data or for the demo.GPT2_lyrics_ckpt_epoch00.ckpt: The pre-trained decoder checkpoint. As mentioned in our paper, we use a pre-trained GPT2 to initialize our decoder and fine-tune it on our lyrics corpus (phase 1). While doing the whole training (phase 2), we start from this fine-tuned one.token_id2emb_dict.pkl: The dict file of each token in vocabulary to WenLan embeddings. It is used to convert the token ids to the corresponding embeddings in phase 1 and phase 2. This is to adapt the text embedding space to the image embedding space. You can also use other pre-trained multimodal representation models (like OpenAI CLIP) to replace WenLan and construct an English one.data files, pre-trained GPT2 checkpoint, and token_id2emb_dict.pkl../data/, ./src/pretrained/ (change the path in ./src/configs.py correspondingly) and ./src/vocab/ respectively.$ cd src/
$ bash train.sh$ cd src/
$ bash generate.shsave_samples_path. You can also use the checkpoint we released to generate on your own data. The format of the data is the same as the test data (without the scores and ratings). You can refer to ./data/test_data.pkl for more details.@inproceedings{10.1145/3503161.3548189,
author = {Cao, Qian and Chen, Xu and Song, Ruihua and Jiang, Hao and Yang, Guang and Cao, Zhao},
title = {Multi-Modal Experience Inspired AI Creation},
year = {2022},
isbn = {9781450392037},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3503161.3548189},
doi = {10.1145/3503161.3548189},
booktitle = {Proceedings of the 30th ACM International Conference on Multimedia},
pages = {1445–1454},
numpages = {10},
keywords = {AI creation, multi-modal, experience},
location = {Lisboa, Portugal},
series = {MM '22}
}