yec22 / Gaussian-DK

Other
29 stars 1 forks source link

Video output #1

Open zhenyuan1234 opened 1 month ago

zhenyuan1234 commented 1 month ago

Excellent work! May I ask how to output the video results? Thanks!

yec22 commented 1 month ago

Thank you for your interest in our work.

Please refer to render_spherify.py

zhenyuan1234 commented 1 month ago

Thank you! May I ask how the enhanced image is obtained, is it just the radiance map that is used to output the results? Which part of the code is used to control the lighting?

yec22 commented 1 month ago

By modifying the ISO value and exposure_time value in gaussian_renderer/__init__.py If you want to light-up the image, you need to increase (e.g. double) both values, and vice versa.

XLR-man commented 3 weeks ago

How can we get the ISO,T and A of a scene?

yec22 commented 3 weeks ago

You can easily use from PIL.ExifTags import TAGS to extract the metadata (ISO, exposure_time) of a captured image (PNG/JPEG). We also provide these metadata of a scene in our proposed dataset.

XLR-man commented 3 weeks ago

You can easily use from PIL.ExifTags import TAGS to extract the metadata (ISO, exposure_time) of a captured image (PNG/JPEG). We also provide these metadata of a scene in our proposed dataset.

Thanks for your reply, and i want to ask how can we get the metadata from our scenes? because our scenes just have low light images without metadata, how can we train your model with our own scenes?

yec22 commented 3 weeks ago

by first extracting metadata from your low light images using PIL.ExifTags.

you can try something like this (just a demo program):

from PIL import Image
from PIL.ExifTags import TAGS
import os
import json

if __name__ == "__main__":
    scene = "your_own_scene"

    img_list = sorted(os.listdir(scene))
    metadata_dict = {}

    for img_file in img_list:
        img_dict = {}
        img = Image.open(os.path.join(scene, img_file))
        exif_data = img._getexif()

        if exif_data is not None:
            for tag_id, value in exif_data.items():
                tag_name = TAGS.get(tag_id, tag_id)
                if tag_name == "ExposureTime":
                    exposure_time = eval(str(value)) * 10.
                    img_dict[tag_name] = exposure_time
                if tag_name == "ISOSpeedRatings":
                    ISO = eval(str(value)) / 1000.
                    img_dict[tag_name] = ISO
                if tag_name == "FNumber":
                    F = eval(str(value))
                    img_dict[tag_name] = F
            print(ISO * exposure_time / (F * F))
            metadata_dict[img_file] = img_dict

    print(metadata_dict)

    with open("metadata.json", "w") as f:
        json.dump(metadata_dict, f)

The hyper-parameters (e.g., 10, 1000) are used to balance the value of different metadata to ensure numerical stability. Feel free to modify them to suit your own scenes.