MCPcopy Create free account
hub / github.com/apple/ml-pointersect / __init__

Method __init__

pointersect/data/hypersim_dataset.py:102–299  ·  view source on GitHub ↗

Args: scene_dir: the root dir of the scene, e.g., /mnt/task_runtime/trove/ml-hypersim-1.0.0/data/raw/ai_001_001. camera_info: a dict containing the corresponding row of metadata_camera_parameters.csv cam_id

(
            self,
            scene_dir: str,
            camera_info: T.Dict[str, T.Any],
            cam_idx: int = -1,
            num_images_per_item: int = None,
            image_subsample: int = 1,
            tonemap: bool = True,
            tonemap_gamma: float = 1. / 2.2,
            tonemap_percentile: float = 90,
            tonemap_percentile_target: float = 0.7,
            tonemap_scale: float = None,
            num_hold_out_items: int = 0,
    )

Source from the content-addressed store, hash-verified

100 """
101
102 def __init__(
103 self,
104 scene_dir: str,
105 camera_info: T.Dict[str, T.Any],
106 cam_idx: int = -1,
107 num_images_per_item: int = None,
108 image_subsample: int = 1,
109 tonemap: bool = True,
110 tonemap_gamma: float = 1. / 2.2,
111 tonemap_percentile: float = 90,
112 tonemap_percentile_target: float = 0.7,
113 tonemap_scale: float = None,
114 num_hold_out_items: int = 0,
115 ):
116 """
117
118 Args:
119 scene_dir:
120 the root dir of the scene,
121 e.g., /mnt/task_runtime/trove/ml-hypersim-1.0.0/data/raw/ai_001_001.
122 camera_info:
123 a dict containing the corresponding row of metadata_camera_parameters.csv
124 cam_idx:
125 camera index, e.g., 0, 1. If -1, combine all cameras.
126 num_images_per_item:
127 number of images/frame_ids to group and form a single sample.
128 If None, use all
129 If negative, it will divide the total samples into `-num_images_per_item` samples.
130 image_subsample: int = 1
131
132 tonemap_gamma:
133 for tone mapping hdr color
134 tonemap_percentile:
135 for tone mapping hdr color
136 tonemap_percentile_target:
137 for tone mapping hdr color. We will set the n-th percentile brightness to the target.
138
139 num_hold_out_items:
140 number of hold out items to keep in the last sample
141 Ref:
142 https://github.com/apple/ml-hypersim/blob/main/contrib/mikeroberts3000/jupyter/01_casting_rays_that_match_hypersim_images.ipynb
143 """
144
145 self.scene_dir = scene_dir
146 self.camera_info = camera_info
147 self.cam_idx = cam_idx
148 self.image_subsample = image_subsample
149 self.num_images_per_item = num_images_per_item
150 self.tonemap = tonemap
151 self.tonemap_gamma = tonemap_gamma
152 self.tonemap_percentile = tonemap_percentile
153 self.tonemap_percentile_target = tonemap_percentile_target
154 self.tonemap_scale = tonemap_scale
155 self.num_hold_out_items = num_hold_out_items
156
157 # gather camera trajectories
158 self.cam_names = get_hypersim_camera_names(
159 volume_id=None,

Callers

nothing calls this directly

Calls 4

get_tonemap_infoMethod · 0.95

Tested by

no test coverage detected