realitycapture nerfacto variable resolution (#1651)

* allow periods within filename, not only for file extension

* don't assume all images are the same resolution

* black reformatting

* Move variable resolution collate logic into vanilla datamanager

* good catch pylint

* now that vanilla supports variable resolution, remove VariableResDataManager

* remove comment

* CONSOLE.print

* avoid `IndexError: tensors used as indices must be long, byte or bool tensors`

* use large dataset parameters for phototourism
This commit is contained in:
machenmusik authored and GitHub committed 2023-03-23 21:45:40 -04:00
1 parent 2b8140b583
commit 83d0d75635
5 files changed
+48 -83

No files matched your search

@@ -59,17 +59,6 @@ def realitycapture_to_json(
for column, value in row.items():
cameras.setdefault(column, []).append(value)
for name in cameras["#name"]:
camera_label = name.rpartition(".")[0]
if camera_label in image_filename_map:
img = np.array(Image.open(output_dir / image_filename_map[camera_label]))
break
height, width, _ = img.shape
data["h"] = int(height)
data["w"] = int(width)
missing_image_data = 0
for i, name in enumerate(cameras["#name"]):
@@ -79,7 +68,12 @@ def realitycapture_to_json(
CONSOLE.print(f"Missing image for camera data {basename}, Skipping")
missing_image_data += 1
continue
frame = {}
img = np.array(Image.open(output_dir / image_filename_map[basename]))
height, width, _ = img.shape
frame["h"] = int(height)
frame["w"] = int(width)
frame["file_path"] = image_filename_map[basename].as_posix()
frame["fl_x"] = float(cameras["f"][i]) * max(width, height) / 36
frame["fl_y"] = float(cameras["f"][i]) * max(width, height) / 36