def __classification_to_annotations__(self,classification,): """ This is the main function projects will have to override - given a set of annotations, we need to return the list of all markings in that annotation """ (lb_roi,ub_roi) = self.current_roi markings = [] for ann in classification["annotations"]: if "finished_at" in ann: break x_pts=[] y_pts=[] for point in ["p0","p1","p2","p3"]: x_pts.append(float(ann[point][0])) y_pts.append(float(ann[point][1])) x = numpy.mean(x_pts) y = numpy.mean(y_pts) if not(MarkingProject.__in_roi__(self,(x,y),lb_roi,ub_roi)): continue try: species = ann["species"] except KeyError: continue if species == "": continue markings.append(((x,y),species)) # assert False return markings
def __classification_to_annotations__( self, classification, ): """ This is the main function projects will have to override - given a set of annotations, we need to return the list of all markings in that annotation """ (lb_roi, ub_roi) = self.current_roi markings = [] for ann in classification["annotations"]: if "finished_at" in ann: break x_pts = [] y_pts = [] for point in ["p0", "p1", "p2", "p3"]: x_pts.append(float(ann[point][0])) y_pts.append(float(ann[point][1])) x = numpy.mean(x_pts) y = numpy.mean(y_pts) if not (MarkingProject.__in_roi__(self, (x, y), lb_roi, ub_roi)): continue try: species = ann["species"] except KeyError: continue if species == "": continue markings.append(((x, y), species)) # assert False return markings
def __init__(self, date="2015-05-06"): MarkingProject.__init__(self, "plankton", date, experts=["yshish"])
def __init__(self,date="2015-05-08",pickle_directory="/tmp/"): MarkingProject.__init__(self, "plankton", date,experts=["yshish"],pickle_directory=pickle_directory)
def __init__(self,date="2015-05-06"): MarkingProject.__init__(self, "plankton", date,experts=["yshish"])