4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00

convert raw to JPG not TIFF, to avoid fast-downscale ffmpeg error (#2295)

This commit is contained in:
machenmusik 2023-08-02 12:44:35 -04:00 committed by GitHub
parent 5b4abc41e6
commit 388fcb09e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ POLYCAM_UPSCALING_TIMES = 2
"""Lowercase suffixes to treat as raw image."""
ALLOWED_RAW_EXTS = [".cr2"]
"""Suffix to use for converted images from raw."""
RAW_CONVERTED_SUFFIX = ".tiff"
RAW_CONVERTED_SUFFIX = ".jpg"
class CameraModel(Enum):
@ -244,7 +244,7 @@ def copy_images_list(
CONSOLE.log(f"Copying image {idx + 1} of {len(image_paths)}...")
copied_image_path = image_dir / f"frame_{idx + 1:05d}{image_path.suffix}"
try:
# if CR2 raw, we want to read raw and write TIFF, and change the file suffix for downstream processing
# if CR2 raw, we want to read raw and write RAW_CONVERTED_SUFFIX, and change the file suffix for downstream processing
if image_path.suffix.lower() in ALLOWED_RAW_EXTS:
copied_image_path = image_dir / f"frame_{idx + 1:05d}{RAW_CONVERTED_SUFFIX}"
with rawpy.imread(str(image_path)) as raw: