|
Download third_party/harmonizer/doc/test_dataset_preparation_tutorial.md from kimjunhan/vkgs-sim: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/third_party/harmonizer/doc/test_dataset_preparation_tutorial.md
- Command line
-
hf download hf://kimjunhan/vkgs-sim/third_party/harmonizer/doc/test_dataset_preparation_tutorial.md
-
curl -L -o test_dataset_preparation_tutorial.md https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/third_party/harmonizer/doc/test_dataset_preparation_tutorial.md
3.52 kB
Harmonizer Test Dataset Preparation Tutorial
This tutorial explains how to prepare test datasets for evaluating the Harmonizer model. The test dataset is used to quantitatively measure model performance using metrics like PSNR and LPIPS.
Dataset Structure
The test dataset should be organized in the following directory structure:
test_dataset/
βββ {scene_id_1}/
β βββ render/
β β βββ {camera_id_1}/
β β β βββ {timestamp_1}.png
β β β βββ {timestamp_2}.png
β β β βββ ...
β β βββ {camera_id_2}/
β β β βββ ...
β β βββ ...
β βββ gt/
β βββ {camera_id_1}/
β β βββ {timestamp_1}.png
β β βββ {timestamp_2}.png
β β βββ ...
β βββ {camera_id_2}/
β β βββ ...
β βββ ...
βββ {scene_id_2}/
β βββ render/
β βββ gt/
βββ ...
Directory Explanation
{scene_id}: A unique identifier for each scene (e.g., UUID like05443ac1-8125-4ace-9daa-6ecdc0df43ff)render/: Contains the degraded/rendered images that will be fed to the Harmonizer model as inputgt/: Contains the ground truth images that will be used to evaluate the model's output{camera_id}: Camera identifier (e.g.,camera_front_tele_30fov,camera_front_wide_120fov){timestamp}.png: Image files with timestamp-based filenames (e.g.,116930318359.png)
Important Notes
- Matching Structure: The
render/andgt/directories must have identical subdirectory structures and matching filenames - Image Format: Images should be in PNG, JPEG, or JPG format
- Filename Matching: For each image in
render/{camera_id}/{timestamp}.png, there must be a correspondinggt/{camera_id}/{timestamp}.png - Resolution: Images can be of any resolution; they will be automatically resized during evaluation
Generating Test Dataset using NuRec
You can generate test datasets using the same methods described in the dataset preparation tutorial (sparse reconstruction, model underfitting, or cross reference), but with specific configurations for test dataset generation.
Running Evaluation
Once your test dataset is prepared, run the evaluation script:
# Start the PyTorch container
docker run --gpus=all --ipc=host -it \
-v $(pwd):/work \
harmonizer-cosmos-env
# Run evaluation
python /work/src/evaluate_test_dataset.py \
--model /work/models/diffusion_harmonizer.pkl \
--input /work/test_dataset
Evaluation Output
The evaluation script will:
- Process each scene and camera in the test dataset
- Apply the Harmonizer model to all rendered images
- Compare the model outputs with ground truth images
- Calculate PSNR and LPIPS metrics
- Save enhanced images to the
evaluation/directory with the same structure astest_dataset/ - Generate a
metrics.yamlfile with:- Overall metrics (mean and standard deviation)
- Per-scene metrics
- Inference time statistics
- GPU memory usage statistics
Example Metrics Output
overall:
psnr_mean: 29.335
psnr_std: 2.028
lpips_mean: 0.109
lpips_std: 0.043
avg_inference_time: 0.025
total_images: 117
per_scene:
05443ac1-8125-4ace-9daa-6ecdc0df43ff:
psnr: 28.716
lpips: 0.187
num_images: 12
avg_inference_time: 0.025
...