user_markings[s].append((x, y)) user_ips[s].append(ip) except (KeyError, ValueError): #classification["annotations"] user_index += -1 if user_markings[5] == []: print "skipping empty" subject_index += -1 continue clusters = {} user_identified_penguins, clusters[5] = DivisiveDBSCAN(3).fit( user_markings[5], user_ips[5], debug=True ) #,base_directory + "/Databases/penguins/images/"+object_id+".JPG") penguins_at[5].append(len(user_identified_penguins)) print str(5) + " - " + str(len(user_identified_penguins)) user_identified_penguins, clusters[20] = DivisiveDBSCAN(6).fit( user_markings[20], user_ips[20], debug=True ) #,base_directory + "/Databases/penguins/images/"+object_id+".JPG") penguins_at[20].append(len(user_identified_penguins)) print str(20) + " - " + str(len(user_identified_penguins)) notFound = 0 total = 0 for clusterIndex in range(len(clusters[5])): newCluster = [] total += 1
except (KeyError, ValueError): #classification["annotations"] user_index += -1 t = zip(complete_annotations, num_annotations) print[c for n, c in t if n] print[c for n, c in t if not (n)] if user_markings[5] == []: print "skipping empty" subject_index += -1 continue for s in steps: user_identified_penguins = DivisiveDBSCAN(3).fit( user_markings[s], user_ips[s] ) #,base_directory + "/Databases/penguins/images/"+object_id+".JPG") penguins_at[s].append(len(user_identified_penguins)) print str(s) + " - " + str(len(user_identified_penguins)) # url = subject["location"]["standard"] # object_id= str(subject["_id"]) # image_path = base_directory+"/Databases/penguins/images/"+object_id+".JPG" # if not(os.path.isfile(image_path)): # urllib.urlretrieve(url, image_path) # # image_file = cbook.get_sample_data(base_directory + "/Databases/penguins/images/"+object_id+".JPG") # image = plt.imread(image_file) # fig, ax = plt.subplots() # im = ax.imshow(image) # plt.show()