while npp.get_estimated_num_remaining_edges() > 0: priority_info = npp.get_next_edge() xyzlocation = priority_info.location (body1, body2) = priority_info.body_pair # proofread body pair at location npp.set_edge_result(priority_info.body_pair, decision%2) decision+=1 num_examined += 1 undo += 1 if not undo%5: status = npp.undo() decision -= 1 num_examined -= 1 if not status: print("Won't undo") decision += 1 num_examined += 1 else: num_undo += 1 #npp.set_synapse_mode(0.1) print(("Num synapse ", num_examined)) print(("Num undo: ", num_undo)) # dump graph npp.export_priority_scheduler(sys.argv[2]) tempfile = open(sys.argv[2]) tempout = tempfile.read() print("SUCCESS")
#!/usr/bin/python import libNeuroProofPriority as npp status = npp.initialize_priority_scheduler("examples/graph.json", .1, .9, .5) num_examined = 0 if status: while npp.get_estimated_num_remaining_edges() > 0: priority_info = npp.get_next_edge() xyzlocation = priority_info.location (body1, body2) = priority_info.body_pair # proofread body pair at location npp.set_edge_result(priority_info.body_pair, 1.0) num_examined += 1 print "Num examined: " , num_examined npp.export_priority_scheduler("output.json")
if not status: exit(1) npp.set_edge_mode(0.1, 0.9, 0.5) while npp.get_estimated_num_remaining_edges() > 0: priority_info = npp.get_next_edge() xyzlocation = priority_info.location (body1, body2) = priority_info.body_pair # proofread body pair at location npp.set_edge_result(priority_info.body_pair, False) num_examined += 1 if num_examined != 610: exit(1) npp.export_priority_scheduler(sys.argv[2]) tempfile = open(sys.argv[2]) groundfile = open(sys.argv[3]) tempout = tempfile.read() groundout = groundfile.read() if tempout != groundout: exit(1) print "SUCCESS"
groundtruth_path = sys.argv[3] status = npp.initialize_priority_scheduler(graph_json, .1, .9, .5) assert status, "initialize_priority_scheduler() failed." npp.set_edge_mode(0.1, 0.9, 0.5) num_examined = 0 while npp.get_estimated_num_remaining_edges() > 0: priority_info = npp.get_next_edge() xyzlocation = priority_info.location (body1, body2) = priority_info.body_pair # proofread body pair at location npp.set_edge_result(priority_info.body_pair, False) num_examined += 1 assert num_examined == 610 npp.export_priority_scheduler(output_path) tempout = open(output_path).read() groundout = open(groundtruth_path).read() assert tempout == groundout, \ "Computed output ({}) doesn't match golden output ({})."\ .format(output_path, groundtruth_path) print("SUCCESS")