Example #1
0
def getLabelsFamilies(annotations_type, annotations_id, dataset_id, iter_max):
    iter_max = None if iter_max == 'None' else int(iter_max)
    annotations_type = AnnotationsTypes[annotations_type]
    return jsonify(annotations_db_tools.get_labels_families(session,
                                                            annotations_type,
                                                            annotations_id,
                                                            dataset_id,
                                                            iter_max=iter_max))
Example #2
0
 def get_labels_families(self, exp):
     annotations_type = exp.exp_conf.annotations_conf.annotations_type
     annotations_id = exp.exp_conf.annotations_conf.annotations_id
     dataset_id = exp.exp_conf.dataset_conf.dataset_id
     return annotations_db_tools.get_labels_families(
                                             exp.session,
                                             annotations_type,
                                             annotations_id, dataset_id,
                                             instance_ids=self.instances_ids)
Example #3
0
def getFamiliesInstances(annotations_type, annotations_id, dataset_id, label,
                         iter_max):
    annotations_type = AnnotationsTypes[annotations_type]
    iter_max = None if iter_max == 'None' else int(iter_max)
    families = annotations_db_tools.get_labels_families(session,
                                                        annotations_type,
                                                        annotations_id,
                                                        dataset_id,
                                                        iter_max=iter_max)
    instances = {}
    for f in families[label]:
        instances[f] = annotations_db_tools.get_label_family_ids(
            session,
            annotations_type,
            annotations_id,
            dataset_id,
            label,
            family=f,
            iter_max=iter_max)
    return jsonify(instances)