MCPcopy Index your code
hub / github.com/diffgram/diffgram / deduct_spatial_coordinates

Method deduct_spatial_coordinates

shared/annotation.py:1545–1581  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1543 self.added_sequence_ids.append(sequence.id) # prevent future deletion from history annotations
1544
1545 def deduct_spatial_coordinates(self):
1546
1547 if self.instance.type in ["global",
1548 'geo_point',
1549 'geo_circle',
1550 'geo_polyline',
1551 'geo_polygon',
1552 'geo_box',
1553 "relation",
1554 "token",
1555 "audio"
1556 ]:
1557 return
1558
1559 min_coords = self.get_min_coordinates_instance(self.instance)
1560 max_coords = self.get_max_coordinates_instance(self.instance)
1561
1562 if self.instance.type in ['cuboid_3d']:
1563 self.instance.min_point_3d = {
1564 'min': {
1565 'x': min_coords[0],
1566 'y': min_coords[1],
1567 'z': min_coords[2]
1568 }
1569 }
1570 self.instance.max_point_3d = {
1571 'max': {
1572 'x': max_coords[0],
1573 'y': max_coords[1],
1574 'z': max_coords[2]
1575 }
1576 }
1577 else:
1578 self.instance.x_min = int(min_coords[0])
1579 self.instance.y_min = int(min_coords[1])
1580 self.instance.x_max = int(max_coords[0])
1581 self.instance.y_max = int(max_coords[1])
1582
1583 def find_serialized_instance_index(self, id):
1584 for i in range(0, len(self.instance_list_kept_serialized)):

Callers 1

update_instanceMethod · 0.95

Tested by

no test coverage detected