示例#1
0
                                 assignments=reps,
                                 input=inp,
                                 title="Compare things to see which is most similar",
                                 description="Compare things and say which is more similar",
                                 reward=payment,
                                 duration=900,
                                 autoapproval=259200,
                                 approvalrate=95,
                                 height=height,
                                 keywords="image, similarity",
                                 numapproved=48,
                                 comment=comment)    


tools.my_write(turk.log_root+"/"+label+".out_file_loc",sys.argv[3])
shutil.copy(sys.argv[2],turk.log_root+"/"+label+".trips")
shutil.copy(sys.argv[1],turk.log_root+"/"+label+".config2")


print "**** The ID of this batch is ",label

print "Waiting 2 minutes"

time.sleep(120)



#label=None
turk.check_til_done(label,sys.argv[3],trips) #outfile

print "DONE, BYE!"
示例#2
0
if "\\" in label or "." in label or "/" in label:
    label = label.replace("/", "\\")
    count = 0
    fname = ""
    for filename in glob.glob(turk.log_root + "/*.out_file_loc"):
        if tools.my_read(filename).strip().replace("/", "\\") == label:
            fname = filename
            count += 1
    if count > 1:
        print "Found more than one .out_file_loc file pointing to", label
        print "Exiting..."
        exit(0)
    if count == 0:
        print "Couldn't find any .out_file_loc file pointing to", label
        print "Maybe try absolute path"
        exit(0)
    label = fname[fname.rindex("\\") + 1:-13]
    print label

trips = tools.remove_comments(
    tools.my_read(turk.log_root + "/" + label + ".trips").strip().split("\n"))
trips = [i.split() for i in trips]
trips = [(int(a), int(b), int(c)) for (a, b, c) in trips]

#label=None
turk.check_til_done(
    label,
    tools.my_read(turk.log_root + "/" + label + ".out_file_loc").strip(),
    trips)
示例#3
0
print "Creating " + str(len(t)) + " hits..."

label, t = turk.load_external_hit(
    url="http://65.215.1.20/faces/simp_sim4.py?instructions=" + inst_shortcut,
    assignments=1,
    input=inp,
    title="Compare things to see which is most similar",
    description="Compare things and say which is more similar",
    reward=payment,
    duration=900,
    autoapproval=259200,
    approvalrate=95,
    height=height,
    keywords="image, similarity",
    numapproved=48,
    comment=comment)

tools.my_write(turk.log_root + + "/" + label + ".out_file_loc", sys.argv[3])
shutil.copy(sys.argv[2], turk.log_root + + "/" + label + ".trips")
shutil.copy(sys.argv[1], turk.log_root + + "/" + label + ".config2")

print "**** The ID of this batch is ", label

print "Waiting 2 minutes"

time.sleep(120)

#label=None
turk.check_til_done(label, sys.argv[3], trips)  #outfile
示例#4
0
if "\\" in label or "." in label or "/" in label:
    label=label.replace("/","\\")
    count = 0
    fname = ""
    for filename in glob.glob(turk.log_root+"/*.out_file_loc"):
        if tools.my_read(filename).strip().replace("/","\\")==label:
            fname = filename
            count += 1
    if count>1:
        print "Found more than one .out_file_loc file pointing to",label
        print "Exiting..."
        exit(0)
    if count==0:
        print "Couldn't find any .out_file_loc file pointing to",label
        print "Maybe try absolute path"
        exit(0)
    label = fname[fname.rindex("\\")+1:-13]
    print label
        
        
trips = tools.remove_comments(tools.my_read(turk.log_root+"/"+label+".trips").strip().split("\n"))
trips = [i.split() for i in trips]
trips = [(int(a),int(b),int(c)) for (a,b,c) in trips]



#label=None
turk.check_til_done(label,tools.my_read(turk.log_root+"/"+label+".out_file_loc").strip(),trips)