Exemplo n.º 1
0
               "palms",
               "hydrants",	
               "buses",
               "crosswalks",
               "traffic_lights",
               "chimneys",
               "stairs",
               "motorbike",
               "bicycles",
               "tractors",
               "taxi",
               "bridges"]

# База данных

new = mDB()  



def deansw(x):
    s = []
    for ix, i in enumerate(x):
        if i == 1:
           s.append(ix+1)
    return s


#def ViPost(x, idx, task, c_box):
#    url = "http://178.158.131.41:9900/"
#    with open(x, "rb") as f:
#            data = f.read()
Exemplo n.º 2
0
    for ix, u in enumerate(data):
        iop = cv2.imread(u["file"])

        #PP = cutimg(iop, ix, 'hydrants3', 3)
        PP = LeoPost(iop, ix, task)  #(iop, ix, 'hydrants3')

        posttoCH = new.see_post(ObjectId(u["_id"]))
        print("Leopost", posttoCH, [int(x) for x in PP["text"]])
        posttoCH["answ_L"] = [int(x) for x in PP["text"]]
        new.upd_post(ObjectId(u["_id"]), posttoCH)

        #R.save(u+";"+str(PP))


if __name__ == "__main__":
    new = data_base.mDB()
    new.create_collection("traffic_lights4x4.tar.gz_2019-12-21 16:07:16"
                          )  #("hydrants error.zip_2019-12-21 16:03:34")
    L = new.see_all_post()
    print("START")
"""
   im_w = len(L)
   w = im_w//20
   w_num = int(im_w/w)
   num = 0 
   for ix in range(0, w_num):
       f_list = L[ix*w:(ix+1)*w]
       #thread_function(ix, f_list, L)
       x = threading.Thread(target=thread_function, args=(ix, f_list, L))
       x.start()
       #print (f_list[:3],len(f_list))