Datasets:
Commit ·
cb0329a
0
Parent(s):
Duplicate from Daniellesry/TransPhy3D
Browse filesCo-authored-by: Shaocong.Xu <Daniellesry@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +65 -0
- README.md +63 -0
- load_demo.py +209 -0
- parametric_train/test/10_materials.000000.tar +3 -0
- parametric_train/test/11_materials.000000.tar +3 -0
- parametric_train/test/12_materials.000000.tar +3 -0
- parametric_train/test/13_materials.000000.tar +3 -0
- parametric_train/test/14_materials.000000.tar +3 -0
- parametric_train/test/15_materials.000000.tar +3 -0
- parametric_train/test/16_materials.000000.tar +3 -0
- parametric_train/test/17_materials.000000.tar +3 -0
- parametric_train/test/18_materials.000000.tar +3 -0
- parametric_train/test/19_materials.000000.tar +3 -0
- parametric_train/test/1_materials.000000.tar +3 -0
- parametric_train/test/20_materials.000000.tar +3 -0
- parametric_train/test/21_materials.000000.tar +3 -0
- parametric_train/test/22_materials.000000.tar +3 -0
- parametric_train/test/23_materials.000000.tar +3 -0
- parametric_train/test/24_materials.000000.tar +3 -0
- parametric_train/test/26_materials.000000.tar +3 -0
- parametric_train/test/27_materials.000000.tar +3 -0
- parametric_train/test/28_materials.000000.tar +3 -0
- parametric_train/test/29_materials.000000.tar +3 -0
- parametric_train/test/2_materials.000000.tar +3 -0
- parametric_train/test/3_materials.000000.tar +3 -0
- parametric_train/test/4_materials.000000.tar +3 -0
- parametric_train/test/5_materials.000000.tar +3 -0
- parametric_train/test/6_materials.000000.tar +3 -0
- parametric_train/test/7_materials.000000.tar +3 -0
- parametric_train/test/8_materials.000000.tar +3 -0
- parametric_train/test/9_materials.000000.tar +3 -0
- parametric_train/training/0_materials.000000.tar +3 -0
- parametric_train/training/1000_materials.000000.tar +3 -0
- parametric_train/training/1001_materials.000000.tar +3 -0
- parametric_train/training/1002_materials.000000.tar +3 -0
- parametric_train/training/1003_materials.000000.tar +3 -0
- parametric_train/training/1004_materials.000000.tar +3 -0
- parametric_train/training/1005_materials.000000.tar +3 -0
- parametric_train/training/1006_materials.000000.tar +3 -0
- parametric_train/training/1007_materials.000000.tar +3 -0
- parametric_train/training/1008_materials.000000.tar +3 -0
- parametric_train/training/1009_materials.000000.tar +3 -0
- parametric_train/training/100_materials.000000.tar +3 -0
- parametric_train/training/1010_materials.000000.tar +3 -0
- parametric_train/training/1011_materials.000000.tar +3 -0
- parametric_train/training/1012_materials.000000.tar +3 -0
- parametric_train/training/1013_materials.000000.tar +3 -0
- parametric_train/training/1014_materials.000000.tar +3 -0
- parametric_train/training/1015_materials.000000.tar +3 -0
- parametric_train/training/1016_materials.000000.tar +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
# Audio files - uncompressed
|
| 39 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
# Audio files - compressed
|
| 43 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
# Image files - uncompressed
|
| 49 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
# Image files - compressed
|
| 54 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
# Video files - compressed
|
| 58 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
parametric_train filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
train filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
test filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
train/**/*.tar filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
test/**/*.tar filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
parametric_train/**/*.tar filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- depth-estimation
|
| 5 |
+
tags:
|
| 6 |
+
- transparency
|
| 7 |
+
- video-depth-estimation
|
| 8 |
+
- computer-vision
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# TransPhy3D
|
| 12 |
+
|
| 13 |
+
[**Project Page**](https://daniellli.github.io/projects/DKT/) | [**Paper**](https://huggingface.co/papers/2512.23705) | [**Code**](https://github.com/Daniellli/DKT)
|
| 14 |
+
|
| 15 |
+
TransPhy3D is a synthetic video corpus of transparent and reflective scenes, consisting of 11k sequences rendered with Blender/Cycles. It provides high-quality RGB frames along with physically based depth and normal labels. The dataset was introduced in the paper "Diffusion Knows Transparency: Repurposing Video Diffusion for Transparent Object Depth and Normal Estimation".
|
| 16 |
+
|
| 17 |
+
## Introduction
|
| 18 |
+
|
| 19 |
+
This dataset aims to provide the first transparent-object oriented video dataset with perfect depth and normal labels, and diverse categories and shapes. Scenes are assembled from a curated bank of category-rich static assets and shape-rich procedural assets paired with glass/plastic/metal materials.
|
| 20 |
+
|
| 21 |
+
## Quick Start
|
| 22 |
+
|
| 23 |
+
The dataset repository includes a demo script to load and visualize the data:
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
python load_demo.py --data_path test/0826_0006_materials.000000.tar --output outputs
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
The results will be saved in the `outputs/` directory as follows:
|
| 30 |
+
```text
|
| 31 |
+
outputs/
|
| 32 |
+
|-- output_depth.mp4
|
| 33 |
+
|-- output_normal.mp4
|
| 34 |
+
`-- output_rgb.mp4
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## Data Structure
|
| 38 |
+
|
| 39 |
+
The dataset is organized as follows:
|
| 40 |
+
|
| 41 |
+
```text
|
| 42 |
+
|-- parametric_train #* the shape-rich dataset
|
| 43 |
+
|-- test
|
| 44 |
+
|-- 1_materials.000000.tar
|
| 45 |
+
|-- ...
|
| 46 |
+
|-- training
|
| 47 |
+
`-- validation
|
| 48 |
+
|-- test #* TransPhy3D-Test
|
| 49 |
+
`-- train #* the category-rich dataset
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Citation
|
| 53 |
+
|
| 54 |
+
If you use this dataset in your research, please cite the following paper:
|
| 55 |
+
|
| 56 |
+
```bibtex
|
| 57 |
+
@article{dkt2025,
|
| 58 |
+
title = {Diffusion Knows Transparency: Repurposing Video Diffusion for Transparent Object Depth and Normal Estimation},
|
| 59 |
+
author = {Shaocong Xu and Songlin Wei and Qizhe Wei and Zheng Geng and Hong Li and Licheng Shen and Qianpu Sun and Shu Han and Bin Ma and Bohan Li and Chongjie Ye and Yuhang Zheng and Nan Wang and Saining Zhang and Hao Zhao},
|
| 60 |
+
journal = {https://arxiv.org/abs/2512.23705},
|
| 61 |
+
year = {2025}
|
| 62 |
+
}
|
| 63 |
+
```
|
load_demo.py
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
from os.path import dirname, join
|
| 4 |
+
import webdataset as wds
|
| 5 |
+
from PIL import Image
|
| 6 |
+
import io
|
| 7 |
+
import json
|
| 8 |
+
import numpy as np
|
| 9 |
+
import argparse
|
| 10 |
+
import matplotlib
|
| 11 |
+
import matplotlib.pyplot as plt
|
| 12 |
+
import os
|
| 13 |
+
try:
|
| 14 |
+
import imageio
|
| 15 |
+
HAS_IMAGEIO = True
|
| 16 |
+
except ImportError:
|
| 17 |
+
HAS_IMAGEIO = False
|
| 18 |
+
try:
|
| 19 |
+
import cv2
|
| 20 |
+
HAS_CV2 = True
|
| 21 |
+
except ImportError:
|
| 22 |
+
HAS_CV2 = False
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def dump_video(image_seq, output_path, fps=30, codec='libx264', quality=8):
|
| 28 |
+
"""
|
| 29 |
+
Dump a sequence of PIL Images to a video file.
|
| 30 |
+
|
| 31 |
+
Args:
|
| 32 |
+
image_seq: List of PIL Images
|
| 33 |
+
output_path: Output video file path (e.g., 'output.mp4')
|
| 34 |
+
fps: Frames per second (default: 30)
|
| 35 |
+
codec: Video codec (default: 'libx264')
|
| 36 |
+
quality: Video quality, 0-10, higher is better (default: 8)
|
| 37 |
+
"""
|
| 38 |
+
if not image_seq:
|
| 39 |
+
print("Warning: Empty image sequence, skipping video dump")
|
| 40 |
+
return
|
| 41 |
+
|
| 42 |
+
if HAS_IMAGEIO:
|
| 43 |
+
# Use imageio (simpler API)
|
| 44 |
+
frames = []
|
| 45 |
+
for img in image_seq:
|
| 46 |
+
# Convert PIL Image to numpy array
|
| 47 |
+
frames.append(np.array(img))
|
| 48 |
+
|
| 49 |
+
# Write video
|
| 50 |
+
# imageio v2 uses mimwrite, v3 uses get_writer
|
| 51 |
+
try:
|
| 52 |
+
# Try imageio v2 API
|
| 53 |
+
imageio.mimwrite(output_path, frames, fps=fps, codec=codec, quality=quality)
|
| 54 |
+
except (AttributeError, TypeError):
|
| 55 |
+
# Fallback for imageio v3
|
| 56 |
+
try:
|
| 57 |
+
writer = imageio.get_writer(output_path, fps=fps, codec=codec)
|
| 58 |
+
for frame in frames:
|
| 59 |
+
writer.append_data(frame)
|
| 60 |
+
writer.close()
|
| 61 |
+
except Exception:
|
| 62 |
+
# Final fallback without codec
|
| 63 |
+
writer = imageio.get_writer(output_path, fps=fps)
|
| 64 |
+
for frame in frames:
|
| 65 |
+
writer.append_data(frame)
|
| 66 |
+
writer.close()
|
| 67 |
+
print(f"Video saved to {output_path} using imageio")
|
| 68 |
+
|
| 69 |
+
elif HAS_CV2:
|
| 70 |
+
# Use OpenCV as fallback
|
| 71 |
+
if not image_seq:
|
| 72 |
+
return
|
| 73 |
+
|
| 74 |
+
# Get image dimensions
|
| 75 |
+
first_img = image_seq[0]
|
| 76 |
+
height, width = first_img.size[1], first_img.size[0]
|
| 77 |
+
|
| 78 |
+
# Define codec and create VideoWriter
|
| 79 |
+
fourcc = cv2.VideoWriter_fourcc(*codec if len(codec) == 4 else 'mp4v')
|
| 80 |
+
out = cv2.VideoWriter(output_path, fourcc, fps, (width, height))
|
| 81 |
+
|
| 82 |
+
for img in image_seq:
|
| 83 |
+
# Convert PIL Image to numpy array (RGB -> BGR for OpenCV)
|
| 84 |
+
img_array = np.array(img)
|
| 85 |
+
if len(img_array.shape) == 3:
|
| 86 |
+
if img_array.shape[2] == 3:
|
| 87 |
+
img_array = cv2.cvtColor(img_array, cv2.COLOR_RGB2BGR)
|
| 88 |
+
elif img_array.shape[2] == 4:
|
| 89 |
+
img_array = cv2.cvtColor(img_array, cv2.COLOR_RGBA2BGR)
|
| 90 |
+
out.write(img_array)
|
| 91 |
+
|
| 92 |
+
out.release()
|
| 93 |
+
print(f"Video saved to {output_path} using OpenCV")
|
| 94 |
+
|
| 95 |
+
else:
|
| 96 |
+
raise ImportError("Neither imageio nor cv2 is available. Please install one: pip install imageio[ffmpeg] or pip install opencv-python")
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
# Parse 16bit depth to actual depth values
|
| 100 |
+
def parse_depth_16bit(depth_image: Image.Image, max_depth: float) -> np.ndarray:
|
| 101 |
+
"""Parse 16-bit depth image back to actual depth values."""
|
| 102 |
+
# Convert PIL image to numpy array
|
| 103 |
+
depth_array = np.array(depth_image, dtype=np.uint16)
|
| 104 |
+
|
| 105 |
+
# Normalize to [0, 1] and multiply by max_depth to get actual depth
|
| 106 |
+
depth_normalized = depth_array.astype(np.float32) / 65535.0
|
| 107 |
+
actual_depth = depth_normalized * max_depth
|
| 108 |
+
|
| 109 |
+
return actual_depth
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def colorize_depth_map(depth, mask=None, reverse_color=False):
|
| 115 |
+
from decord import VideoReader,cpu
|
| 116 |
+
|
| 117 |
+
cm = matplotlib.colormaps["Spectral"]
|
| 118 |
+
|
| 119 |
+
# colorize
|
| 120 |
+
if reverse_color:
|
| 121 |
+
img_colored_np = cm(1 - depth, bytes=False)[:, :, 0:3] # Invert the depth values before applying colormap
|
| 122 |
+
else:
|
| 123 |
+
img_colored_np = cm(depth, bytes=False)[:, :, 0:3] # (h,w,3)
|
| 124 |
+
|
| 125 |
+
depth_colored = (img_colored_np * 255).astype(np.uint8)
|
| 126 |
+
# if mask is not None:
|
| 127 |
+
# masked_image = np.zeros_like(depth_colored)
|
| 128 |
+
# masked_image[mask.numpy()] = depth_colored[mask.numpy()]
|
| 129 |
+
# depth_colored_img = Image.fromarray(masked_image)
|
| 130 |
+
# else:
|
| 131 |
+
depth_colored_img = Image.fromarray(depth_colored)
|
| 132 |
+
return depth_colored_img
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
if __name__ == '__main__':
|
| 136 |
+
|
| 137 |
+
args = argparse.ArgumentParser()
|
| 138 |
+
args.add_argument('--data_path', type=str, default='data/TransPhy3D/parametric_train/training/0_materials.000000.tar')
|
| 139 |
+
args.add_argument('--output_path', type=str, default='output')
|
| 140 |
+
args = args.parse_args()
|
| 141 |
+
|
| 142 |
+
os.makedirs(args.output_path, exist_ok=True)
|
| 143 |
+
|
| 144 |
+
# Use WebDataset's built-in verification
|
| 145 |
+
dataset = wds.WebDataset(args.data_path)
|
| 146 |
+
data = {}
|
| 147 |
+
|
| 148 |
+
depth_seq_raw = [] # Store raw 16bit depth images
|
| 149 |
+
depth_max_values = [] # Store max_depth for each frame
|
| 150 |
+
normal_seq = []
|
| 151 |
+
rgbs_seq = []
|
| 152 |
+
meta_info =[]
|
| 153 |
+
|
| 154 |
+
# First pass: load all data including 16bit depth
|
| 155 |
+
for sample in dataset:
|
| 156 |
+
depth_img = None
|
| 157 |
+
max_depth = None
|
| 158 |
+
for key, value in sample.items():
|
| 159 |
+
# Ensure value is bytes-like
|
| 160 |
+
if not isinstance(value, (bytes, bytearray)):
|
| 161 |
+
continue
|
| 162 |
+
|
| 163 |
+
# Match exact key names or check file extension
|
| 164 |
+
if key == 'depth.png':
|
| 165 |
+
# Load 16bit depth image
|
| 166 |
+
depth_img = Image.open(io.BytesIO(value))
|
| 167 |
+
elif key == 'depth.json':
|
| 168 |
+
# Load max_depth value
|
| 169 |
+
depth_info = json.loads(value)
|
| 170 |
+
max_depth = depth_info.get('max_depth', None)
|
| 171 |
+
elif key == 'normal.png':
|
| 172 |
+
img = Image.open(io.BytesIO(value))
|
| 173 |
+
normal_seq.append(img)
|
| 174 |
+
elif key == 'image.png':
|
| 175 |
+
img = Image.open(io.BytesIO(value))
|
| 176 |
+
rgbs_seq.append(img)
|
| 177 |
+
elif key.endswith('.json'):
|
| 178 |
+
meta_info.append(json.loads(value))
|
| 179 |
+
|
| 180 |
+
# Store depth data if both image and max_depth are available
|
| 181 |
+
if depth_img is not None:
|
| 182 |
+
depth_seq_raw.append(depth_img)
|
| 183 |
+
depth_max_values.append(max_depth)
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
#* depth processing
|
| 188 |
+
depth_seq_vis = []
|
| 189 |
+
for depth_img, max_depth in zip(depth_seq_raw, depth_max_values):
|
| 190 |
+
if max_depth is not None:
|
| 191 |
+
# Parse 16bit depth to actual depth values
|
| 192 |
+
#* show how to convert to original depth unit
|
| 193 |
+
actual_depth = parse_depth_16bit(depth_img, max_depth)
|
| 194 |
+
|
| 195 |
+
# Normalize for visualization (0-255)
|
| 196 |
+
depth_normalized = actual_depth / max_depth # [0, 1]
|
| 197 |
+
depth_colored_img = colorize_depth_map(depth_normalized)
|
| 198 |
+
|
| 199 |
+
depth_seq_vis.append(depth_colored_img)
|
| 200 |
+
else:
|
| 201 |
+
# Fallback: use raw depth image if max_depth not available
|
| 202 |
+
depth_seq_vis.append(depth_img.convert('L'))
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
dump_video(rgbs_seq, join(args.output_path, 'output_rgb.mp4'), fps=30)
|
| 207 |
+
dump_video(normal_seq, join(args.output_path, 'output_normal.mp4'), fps=30)
|
| 208 |
+
dump_video(depth_seq_vis, join(args.output_path, 'output_depth.mp4'), fps=30)
|
| 209 |
+
|
parametric_train/test/10_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61edaf2cf29fb79130af4764c197568ada697454d17170d40199e87134c9813a
|
| 3 |
+
size 142090240
|
parametric_train/test/11_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57e9edef9e72f02a325e2c6425796fcd5619f328dee94f0517ca9e1c165ff50e
|
| 3 |
+
size 155535360
|
parametric_train/test/12_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9f3e56be2a4bc77dae3ae8f5a0a358b9560f182a57e4b3425d61d800819a21ca
|
| 3 |
+
size 141506560
|
parametric_train/test/13_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35d3dad54f7479f4310ecab9d4f2235ea42480b025d1429a69fe390a063966d1
|
| 3 |
+
size 141455360
|
parametric_train/test/14_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:934cbd230a8c2dc0913ee94c19b6a3b0684338aaf6c1dd242147f83523b5b389
|
| 3 |
+
size 142059520
|
parametric_train/test/15_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed059a7c5bf84dbd9e9a992e3352a38f1e19f14ed6549d38f28d7d6e5c22c3b1
|
| 3 |
+
size 156364800
|
parametric_train/test/16_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0d960a8f519c7e14c60c42a447c4538ab00c4e4908943a53195307fbb7b8953
|
| 3 |
+
size 142049280
|
parametric_train/test/17_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eca6005eda9a70da12dc96ac60e2323cf9c80c17a8eca69d0473ad34cfb6c293
|
| 3 |
+
size 155443200
|
parametric_train/test/18_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:722803601be6f2c405d94394b9384203dcb5c51426014ff5d11c7c3104a3cdf4
|
| 3 |
+
size 142284800
|
parametric_train/test/19_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15a29c51e69aba7518ad6596705a9dafeae6a5674a38aa0c64d20c16974f01b1
|
| 3 |
+
size 155637760
|
parametric_train/test/1_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4e287595622c2576520b255777ee0a790adb0e7a25e0e602dc274f6455d0d8c
|
| 3 |
+
size 143073280
|
parametric_train/test/20_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59a012a8dd241633af7c160453682da3853c3d9f3f5c3aeb4fa7b3ff35929924
|
| 3 |
+
size 155883520
|
parametric_train/test/21_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a3c6f5238594c9444d05cd5934116bb3539d8c0bab3aefd3257f9feb28ab526
|
| 3 |
+
size 141721600
|
parametric_train/test/22_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:baa7918a817dd635148a96226fc17e8d8afcdba067aeda8fe2c065523cac7e17
|
| 3 |
+
size 156139520
|
parametric_train/test/23_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94419dbc760f935d8aa04c872ab9fa710052433f5420df170c171a1115d9866f
|
| 3 |
+
size 142653440
|
parametric_train/test/24_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a917fe6262e7fdcb6518499fe68312f157c59726f5e25866aa79f687e1906fd
|
| 3 |
+
size 156477440
|
parametric_train/test/26_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d17d4abc4d12560f4584ec7823758d6352df96c515d3d6b75d110e07d3793a5
|
| 3 |
+
size 142551040
|
parametric_train/test/27_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:17507296401281eb8b9e0d47f521681f1db68c76f2c4e8816c3395b7bebe9d1c
|
| 3 |
+
size 141977600
|
parametric_train/test/28_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad41332da39d45fdbce6fbf9df7f95fd0ad40068e379b0f33e6aa3f52bc18d23
|
| 3 |
+
size 143226880
|
parametric_train/test/29_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74f36551fa049f789cc8e068772bc7adc2a17f30ad253249f2e7ea87621c3d32
|
| 3 |
+
size 142254080
|
parametric_train/test/2_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:162f63b0231029984faa7379593b202668c16b6458e812b9c979113fb7509991
|
| 3 |
+
size 141864960
|
parametric_train/test/3_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b22faddc989f8dd69de79f3efa6707c09045b3934af1d7cb15be5907d331a4c0
|
| 3 |
+
size 141895680
|
parametric_train/test/4_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fa906d975d3493b51548fddedaec9a530a3d8112f0338065e68ddec7a05fdf50
|
| 3 |
+
size 155873280
|
parametric_train/test/5_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5d0ee8f90598063b4228249579e042c1337ad2ad97a1255f59f0d4533ebdd80d
|
| 3 |
+
size 155566080
|
parametric_train/test/6_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2c11774d15e2b5ff5b2222ef57ce0bc52e99e6a76f5476520ce60e99636d1b7
|
| 3 |
+
size 142807040
|
parametric_train/test/7_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e4d420a0385ba33d2878820243c512aa5c0f04faaf262fbf75b11af8263dce9
|
| 3 |
+
size 156016640
|
parametric_train/test/8_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2fe1ca9e04984b2a7baa003f4669a95fe4810f8ce38da78eb0b4a2b14f16c29
|
| 3 |
+
size 142684160
|
parametric_train/test/9_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b783a0d06fcd04a827ac358fe9b99676eac9dd0dfaa9bdea9c85a2b78c17fdf4
|
| 3 |
+
size 141875200
|
parametric_train/training/0_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d185762b8b5ec47ff31f50cf394357754f4dc8302b8a337d19fe11f0d6b232ef
|
| 3 |
+
size 142264320
|
parametric_train/training/1000_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4826d5eea43b4e3152266ff99af1cd06c51ec449475b4729b585d963334f4096
|
| 3 |
+
size 141916160
|
parametric_train/training/1001_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c0ca3debc2fc18a2e4af2ec86572f9b3e5b491eb35059a72022a1aacac19049
|
| 3 |
+
size 141803520
|
parametric_train/training/1002_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e860ceef0fa989a4ccea750ba8c34d12c004256a38d6547472aa99f894849b9
|
| 3 |
+
size 142469120
|
parametric_train/training/1003_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f078ea1a92b6ae7f7141a55049bc6a39ee03b0c010a2730da9644cd2b84b16f6
|
| 3 |
+
size 141916160
|
parametric_train/training/1004_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4bb5de2314c23290cc693113eae1ea5d79354a9d74577f6324d26c3dd0404ac2
|
| 3 |
+
size 132403200
|
parametric_train/training/1005_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6964efa7b721086d5641e8a4ad99766907d308c0b79da28475c6c727ae321126
|
| 3 |
+
size 141660160
|
parametric_train/training/1006_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d9af627ab1ec5b2a75f68af7fd832696fc7946cd4ea8c022e116b6361b02a9da
|
| 3 |
+
size 141813760
|
parametric_train/training/1007_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57ab00a1ae24e251bc19564783c69e229a12cbefba27cd2fd85654505f7b4e44
|
| 3 |
+
size 142510080
|
parametric_train/training/1008_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99a3396681ddd0e7ffc160e84db31eef84f452eb7895ce0a91f0e23732f4092c
|
| 3 |
+
size 141312000
|
parametric_train/training/1009_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75f5cc9ae6d91c6a3bfe9217f72391ff4d82b65d110826b3a50e4eb2f598ac38
|
| 3 |
+
size 142172160
|
parametric_train/training/100_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25e73fdd4cb6ebd1844686e18f546d272622b20f91e676a550d738259bd4cdf7
|
| 3 |
+
size 142039040
|
parametric_train/training/1010_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf1088a68b129be6141a6c6bc2e7a24b6ee6aa0474518d8fbbd4fc5e6ed93b81
|
| 3 |
+
size 142653440
|
parametric_train/training/1011_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a230e2d06d86d85dbf856bfe93c7589fa8269cc6a49ce30c6f3aabe887f6bb4
|
| 3 |
+
size 141803520
|
parametric_train/training/1012_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f50a004ab4110a6274936f78e11620390a84732eb3a4fb0f9b969da9c7ff3f1f
|
| 3 |
+
size 141772800
|
parametric_train/training/1013_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a87e7f09fc7c4bffad113259006dc98279a5cd2643a44adc698eb1e91579d0a6
|
| 3 |
+
size 141527040
|
parametric_train/training/1014_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a315bb0d2fd7924b571f6f64486016282501d3b0f3811925896078c28bba7d5a
|
| 3 |
+
size 142069760
|
parametric_train/training/1015_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c396b47b1b8971ec10fd70e99469b0af7881c722db91271e9c93ddf20960ce75
|
| 3 |
+
size 143155200
|
parametric_train/training/1016_materials.000000.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:794fedd155b5a735e392b9820ec3c11189391b99fb99b1ebfad2db02f182d8ee
|
| 3 |
+
size 141608960
|