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

Method hash_instance

shared/database/annotation/instance.py:308–380  ·  view source on GitHub ↗

Important -> Used in core annotation saving function Must call if we do any updates to an instance It's ok if this has None values, it should be the same for all instance types I wonder if this should be part of a default method for instance itself?

(self)

Source from the content-addressed store, hash-verified

306 self.file.set_cache_key_dirty(cache_key = 'instance_list')
307
308 def hash_instance(self) -> None:
309 """
310 Important -> Used in core annotation saving function
311
312 Must call if we do any updates to an instance
313
314 It's ok if this has None values,
315 it should be the same for all instance types
316
317 I wonder if this should be part of a default method for instance itself?
318 Feels almost like a serialization thing.
319
320 Updates in place
321
322 CAUTION
323 anything we add here must be "static".
324 if we add a datetime it will create an infinite loop
325 since every instance will be "new".
326
327 """
328
329 hash_data = [
330 self.type,
331 self.x_min,
332 self.y_min,
333 self.y_max,
334 self.x_max,
335 self.p1,
336 self.p2,
337 self.cp,
338 self.center_x,
339 self.center_y,
340 self.rotation_euler_angles,
341 self.position_3d,
342 self.center_3d,
343 self.dimensions_3d,
344 self.angle,
345 self.width,
346 self.height,
347 self.start_char,
348 self.end_char,
349 self.start_token,
350 self.end_token,
351 self.start_sentence,
352 self.end_sentence,
353 self.sentence,
354 self.label_file_id,
355 self.number,
356 self.rating,
357 self.points,
358 self.front_face,
359 self.rear_face,
360 self.soft_delete,
361 self.attribute_groups,
362 self.machine_made,
363 self.sequence_id,
364 self.nodes,
365 self.edges,

Calls

no outgoing calls