Example #1
0
def process_edge(body2gtbody, nomerge_hist, tot_hist, nomerge_hist2, tot_hist2, dirtybodies, bodyremap):
    priority = neuroproof.get_next_edge()
    (body1, body2) = priority.body_pair
    weight = neuroproof.get_edge_val(priority)  

    if body1 not in dirtybodies and body2 not in dirtybodies:
        tot_hist[int(weight*100)] += 1
    tot_hist2[int(weight*100)] += 1
    link = True
    if body2gtbody[body1] != body2gtbody[body2]:
        if body1 not in dirtybodies and body2 not in dirtybodies:
            nomerge_hist[int(weight*100)] += 1
        nomerge_hist2[int(weight*100)] += 1
        link = False
    else:
        if body2 not in bodyremap:
            bodyremap[body2] = [body2]
        if body1 not in bodyremap:
            bodyremap[body1] = [body1]

        dirtybodies.add(body1)
        bodyremap[body1].extend(bodyremap[body2])
        del bodyremap[body2]


    neuroproof.set_edge_result(priority.body_pair, link)
# body mode
#npp.set_edge_mode(0.1, 0.9, 0.5)
num_examined = 0
npp.set_body_mode(25000, 0)

decision = 0
undo = 0
num_undo = 0

npp.estimate_work()
estimated = npp.get_estimated_num_remaining_edges()

print(("Num estimated edges: ", estimated))

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:
	num_examined -= 1
	decision -= 1
	status = npp.undo()
	if not status:
	    print("Won't undo")
	    decision += 1
Example #3
0
import libNeuroProofPriority as npp
import sys

status = npp.initialize_priority_scheduler(sys.argv[1], .1, .9, .5)

num_examined = 0

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()