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

Method hash_update

shared/database/source_control/file.py:564–594  ·  view source on GitHub ↗

Takes file (image + annotation HASHES) and hashes it Arguments: file, File object Uses from File() instance_list, list of annotation Instances Returns: hash, id_list_box, integer ids id_li

(self)

Source from the content-addressed store, hash-verified

562 return session.query(File).filter(File.id.in_(file_id_list)).all()
563
564 def hash_update(self):
565 """
566 Takes file
567 (image + annotation HASHES)
568 and hashes it
569
570 Arguments:
571 file, File object
572
573 Uses from File()
574 instance_list, list of annotation Instances
575
576 Returns:
577 hash,
578 id_list_box, integer ids
579 id_list_polygon
580
581 """
582
583 hash_data = []
584 hash_data.append([self.image_id, self.video_id, self.label_id])
585
586 hash_list_instance = build_annotation_hash_list(self.instance_list)
587
588 hash_data = hash_data + hash_list_instance
589
590 hash = hashlib.sha256(json.dumps(hash_data, sort_keys = True).encode('utf-8')).hexdigest()
591
592 self.hash = hash
593
594 return hash
595
596 # get_by_id_and_project is defined in file_oeprations.py
597

Callers 3

newMethod · 0.95
remove_coreFunction · 0.80
update_file_hashMethod · 0.80

Calls 1

Tested by

no test coverage detected