Example #1
0
def run():
    """
        通过先检测,进行更新话题列表,以类进行搜索
        :return:
    """
    print len(WeiboPage.detected_tpdict)
    detection()  # 检测新事件,进而更新话题列表
    muL_ss()  # 对新的话题列表进行重新分类,并开始搜索
Example #2
0
def run():
    """
        通过先检测,进行更新话题列表,以类进行搜索
        :return:
    """
    print len(WeiboPage.detected_tpdict)
    detection()  # 检测新事件,进而更新话题列表
    muL_ss()  # 对新的话题列表进行重新分类,并开始搜索
Example #3
0
 def run(self):
     """
         调用更新方法,更新完毕后进行新话题检测
         :return:
     """
     print "再次更新长度为x的话题", len(WeiboPage.afore_all_uid)
     if WeiboPage.afore_all_uid:
         print "开始更新"
         Update(self.one_user).update()
     else:
         print "无内容,不更新,开始检测"
     detection()
Example #4
0
def consumer(q1, q,namespace):
    global finished
    global token

    print os.getpid(), 'consumer start'
    while True:
        try:
            if finished: break
            if q.qsize() == 0: 
               time.sleep(2.0)
               continue
            w = q.get(False)
            try:
                detection(w)
                res = csv_filename
                post_result(token,res)

            except:
                traceback.print_exc()
                q.put(w,False)

        except:
            traceback.print_exc()
    print os.getpid(), 'consumer done'
Example #5
0
def detection(w):
    # TODO  implement coding here
    detection(w)
    print 'handling %d.jpg'%w
def original_per_sites_bouger(cdoc, usb):
    for i in range(0, len(cdoc)):
        for value in usb.values():
            if cdoc[i] == value[1]:
                value[3] = value[3] + 1

    return usb

print('nombre de site bouger = {}'.format(len(nombre_de_site_bouger)))

from detection import *

seuil = 0.1

res = detection(aaa, cle1, seuil, delta, 2)

print("detecte = ", res)

usb = unique_sites_bouger(sites_bouger)

usb1 = original_per_sites_bouger(aa_copy, usb)

print("len usb = ", len(usb))

print(usb1)

print("----------------------")
print(sites_bouger)
print("----------------------")
Example #7
0
    ESU(forCounter)
    dataName = "data" + str(forCounter)
    b = np.ones((2, 1))
    b[0][0] = x_position_initial
    b[1][0] = y_position_initial
    pastSL = np.concatenate((pastSL, b), axis=1)

    objeCordinates, destinationPoints = dataMeas(dataName, pastSL)
    print("obje Cordinates ADPM", objeCordinates)
    #    for j in range(objeCordinates.shape[0]):
    #        pastObjeCoordinateX = np.append(pastObjeCoordinateX,objeCordinates[j][0])
    #        pastObjeCoordinateY = np.append(pastObjeCoordinateY,objeCordinates[j][1])

    if p == 1:
        xc1, yc1, xc2, yc2, modeC, rmin = detection(forCounter,
                                                    x_position_initial,
                                                    y_position_initial,
                                                    angle * math.pi / 180)
        print(xc1, yc1, xc2, yc2, modeC)
        if (rmin < 120):
            desired_x_position = x_position_initial + (
                280 - rmin) * math.cos(angle * math.pi / 180 - math.pi)
            desired_y_position = y_position_initial + (
                280 - rmin) * math.sin(angle * math.pi / 180 - math.pi)
            [x_position, y_position,
             angle] = self_localization_part(x_position_initial,
                                             y_position_initial, angle_initial,
                                             desired_x_position,
                                             desired_y_position, forCounter)
            print("x_pos ", x_position, "y_pos ", y_position, "angle ", angle)
            x_position_initial = x_position
            y_position_initial = y_position