Follow these steps to organize, convert, and download the datasets into the required img2dataset format.
1. Setup dataset folders and move annotations
Set the MINIGPT4_DATASET environment variable to your large storage path and organize the JSON files.
2. Copy conversion and download scripts
Move the provided scripts into their respective dataset folders so they can be executed locally within the data storage directory.
3. Convert annotation formats
Run the conversion scripts to transform the JSON annotations into the img2dataset format (generating .tsv files).
4. Download datasets
Execute the shell scripts to download the actual image data using img2dataset.
# 1. Setup folders
export MINIGPT4_DATASET=/YOUR/PATH/FOR/LARGE/DATASET/
mkdir ${MINIGPT4_DATASET}/cc_sbu
mkdir ${MINIGPT4_DATASET}/laion
mv ccs_synthetic_filtered_large.json ${MINIGPT4_DATASET}/cc_sbu
mv laion_synthetic_filtered_large.json ${MINIGPT4_DATASET}/laion
# 2. Copy scripts
cp convert_cc_sbu.py ${MINIGPT4_DATASET}/cc_sbu
cp download_cc_sbu.sh ${MINIGPT4_DATASET}/cc_sbu
cp convert_laion.py ${MINIGPT4_DATASET}/laion
cp download_laion.sh ${MINIGPT4_DATASET}/laion
# 3. Convert annotations
cd ${MINIGPT4_DATASET}/cc_sbu
python convert_cc_sbu.py
cd ${MINIGPT4_DATASET}/laion
python convert_laion.py
# 4. Download data
cd ${MINIGPT4_DATASET}/cc_sbu
sh download_cc_sbu.sh
cd ${MINIGPT4_DATASET}/laion
sh download_laion.sh