COCO Dataset Preparation

November 19, 2025 · View on GitHub

Follow the steps below to prepare the COCO Dataset for SAM-3D-Body Data.


  • Set the following environment variables to simplify directory references:

    export COCO_IMG_DIR=/path/to/coco/images
    
  • Download and extract the COCO2014 dataset.

    cd $COCO_IMG_DIR
    wget http://images.cocodataset.org/zips/train2014.zip
    wget http://images.cocodataset.org/zips/val2014.zip
    wget http://images.cocodataset.org/zips/test2014.zip
    unzip train2014.zip 
    unzip val2014.zip 
    unzip test2014.zip 
    rm train2014.zip val2014.zip test2014.zip 
    
  • $COCO_IMG_DIR should follow the directory structure below.

    $COCO_IMG_DIR
    ├── test2014
    ├── train2014
    └── val2014