mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 13:59:10 +08:00
Two exposures - with weighted loss
This commit is contained in:
1 parent
1cea0fe30e
commit
836ac8b223
12 files changed
+544
-18
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
import numpy as np
|
||||
from tqdm import tqdm
|
||||
from envmap import EnvironmentMap, rotation_matrix
|
||||
from hdrio import imwrite
|
||||
|
||||
# Outdoor Table
|
||||
LDR_dir = '/mnt/data/arch_level1/panoramas_first_100/'
|
||||
HDR_dir = '/mnt/data/arch_level1/panoramas_256x512_hdr/'
|
||||
output_dir = '/mnt/data/arch_level1/panoramas_LDR_HDR_small/'
|
||||
|
||||
imgFiles = [os.path.join(LDR_dir, f) for f in os.listdir(LDR_dir) if os.path.isfile(os.path.join(LDR_dir, f)) and f.endswith('.png')]
|
||||
imgFiles.sort()
|
||||
|
||||
for ldr_addr in tqdm(imgFiles):
|
||||
ldr_pano = EnvironmentMap(ldr_addr, 'latlong')
|
||||
|
||||
hdr_addr = ldr_addr.replace('.png', '.exr')
|
||||
hdr_addr = hdr_addr.replace(LDR_dir, HDR_dir)
|
||||
assert os.path.exists(hdr_addr), "HDR file does not exists!!!"
|
||||
hdr_pano = EnvironmentMap(hdr_addr, 'latlong')
|
||||
hdr_pano.resize(1920)
|
||||
|
||||
out_pano = ldr_pano.data ** 2.2
|
||||
list_hdr = hdr_pano.data > 1.0
|
||||
print("list_hdr.shape: ", list_hdr.shape, "list_hdr.shape: ", ldr_pano.data.shape)
|
||||
out_pano[list_hdr] = hdr_pano.data[list_hdr]
|
||||
|
||||
out_addr = hdr_addr.replace(HDR_dir, output_dir)
|
||||
imwrite(out_pano, out_addr)
|
||||
|
||||
print("Done!")
|
||||
Reference in new issue
Block a user