MCPcopy Create free account
hub / github.com/InternRobotics/EmbodiedScan / list_instances

Method list_instances

embodiedscan/explorer.py:185–208  ·  view source on GitHub ↗

List all the instance annotations in the scene. Args: scene (str): Scene name. Returns: list[dict] or None: List of all the instance annotations. If there is no instances, we will return None.

(self, scene)

Source from the content-addressed store, hash-verified

183 return None
184
185 def list_instances(self, scene):
186 """List all the instance annotations in the scene.
187
188 Args:
189 scene (str): Scene name.
190
191 Returns:
192 list[dict] or None: List of all the instance annotations. If there
193 is no instances, we will return None.
194 """
195 for sample in self.data:
196 if sample['sample_idx'] == scene:
197 res = []
198 for instance in sample['instances']:
199 label = self.classes[self.id_to_index[
200 instance['bbox_label_3d']]]
201 res.append({
202 '9dof_bbox': instance['bbox_3d'],
203 'label': label
204 })
205 return res
206
207 print('No such scene')
208 return None
209
210 def scene_info(self, scene_name):
211 """Show the info of the given scene.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected