Duplicate Detection Specific Class

In Diffgram

Search Duplicate Label Detector

Example Use Cases

There are multiple classes expected. Certain classes are expected to only exist once.

The script will warn if multiple instances exist, otherwise will inform user no duplicates exist.

let duplicate_instances = []
let found_label_file_ids = []

let target_name = "change_me_to_something"
let label_file = diffgram.label_list.find(
      x=> {return x.label.name == target_name})
    
for (let instance of diffgram.instance_list){
  	if (instance.soft_delete == true) {continue}
    if(instance.label_file_id != label_file.id) {continue}
	
  	if (!found_label_file_ids.includes(instance.label_file_id)) {
       found_label_file_ids.push(instance.label_file_id)   	
    } else {
    	duplicate_instances.push(instance)
    }
}

if (duplicate_instances.length > 0) {
    let instance = duplicate_instances[0]
    let message = "Duplicate: " + target_name
	diffgram.show_snackbar(message)
} else {
  let message = "No duplicates of " + target_name + " found."
  diffgram.show_snackbar(message)
}
868 905