Skip to content

The NyuV2 Raw Dataset Extractor is a Python project that processes the raw dataset from NyuV2. It provides operations like depth map colorization, undistortion, and frame synchronization to create video sequences. This Python adaptation of the official NyuV2 toolbox simplifies dataset manipulation.

Notifications You must be signed in to change notification settings

Lucass97/nyuv2_raw_dataset_extractor

Repository files navigation

NyuV2 Raw Dataset Extractor

The NyuV2 Raw Dataset Extractor is a Python project that aims to process the raw dataset provided by NyuV2 and perform various operations such as fill depth colorization and undistortion on the depth maps and RGB images. Additionally, it synchronizes the frames to create a video sequence. This implementation is a partial Python adaptation of the official NyuV2 toolbox, which is developed in MATLAB.

To obtain more information, please refer to the official link here.

Table of Contents

Installation

To use the NyuV2 Raw Dataset Extractor, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your/repository.git
  2. Navigate to the project directory:

    cd nyuv2-raw-dataset-extractor
  3. Create and activate a virtual environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate

    To create a new virtual environment (venv), use the guide at the following link.

  4. Install the required dependencies:

    pip install -r requirements.txt

Download Raw Dataset

To download the raw NYUv2 dataset, you can use the provided download-raw-dataset.sh script located in the data/raw directory. The script automatically downloads the required dataset files and verifies their integrity using MD5 checksums.

To download the dataset, follow these steps:

  1. Open a terminal and navigate to the project directory:
cd nyuv2-raw-dataset-extractor/data/raw
  1. Give execute permission to the download-raw-dataset.sh script:
chmod +x download-raw-dataset.sh
  1. Execute the download-raw-dataset.sh script:
./download-raw-dataset.sh

The script will download the necessary dataset files and display progress messages. It will also calculate the MD5 checksums of the downloaded files and verify their integrity.

Usage

To use the NyuV2 Raw Dataset Extractor, execute the extractor.py script with the desired command line arguments. The script processes the raw dataset and performs the specified operations on the data.

python extractor.py 
      --path <path_to_raw_dataset>
      --output_dir <output_directory>
      [--undistort] [--save-undistort-diff] [--fill-depth]

Command Line Arguments

The following command line arguments are available for the NyuV2 Raw Dataset Extractor:

  • --path (default: "data/raw/basement.zip") - Specifies the relative path to the raw dataset archive file in ZIP format.
  • --output_dir - (default: "data/extracted") Specifies the output directory where the processed data will be saved.
  • --undistort (default: True) - Enables undistortion of RGB and depth images.
  • --save-undistort-diff (default: False) - Saves the difference between the original and undistorted images.
  • --fill-depth (default: False) - Uses the fill depth colorization algorithm.

Extract All Script

The extract-all.sh script provided allows for the extraction and processing of multiple ZIP files from a specified directory. It automates the extraction process using the extract.py script for each ZIP file found in the data/raw directory. The resulting data will be saved in the data/extracted directory.

To utilize the extract-all.sh script, follow these steps:

  1. Open a terminal and navigate to the project directory.

  2. Ensure that you have set up the required dependencies and the virtual environment, as described in the installation instructions.

  3. Provide execute permission to the extract-all.sh script:

chmod +x extract-all.sh
  1. Run the extract-all.sh script:
./extract-all.sh

The script will iterate over all the ZIP files found in the data/raw directory. For each file, it will execute the extract.py script with the specified command line arguments, extracting the data and performing any necessary processing. The extracted data will be saved in the data/extracted directory.

About

The NyuV2 Raw Dataset Extractor is a Python project that processes the raw dataset from NyuV2. It provides operations like depth map colorization, undistortion, and frame synchronization to create video sequences. This Python adaptation of the official NyuV2 toolbox simplifies dataset manipulation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published