當前位置: 首頁>>代碼示例>>Python>>正文


Python tracker.Tracker方法代碼示例

本文整理匯總了Python中tracker.Tracker方法的典型用法代碼示例。如果您正苦於以下問題:Python tracker.Tracker方法的具體用法?Python tracker.Tracker怎麽用?Python tracker.Tracker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tracker的用法示例。


在下文中一共展示了tracker.Tracker方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import tracker [as 別名]
# 或者: from tracker import Tracker [as 別名]
def __init__(self, dht_addr, state_path, routing_m_mod, lookup_m_mod, private_dht_name):
        message.private_dht_name = private_dht_name
        self.state_filename = os.path.join(state_path, STATE_FILENAME)
        self.load_state()
        if not self._my_id:
            self._my_id = identifier.RandomId()
        self._my_node = Node(dht_addr, self._my_id)
        self._tracker = tracker.Tracker()
        self._token_m = token_manager.TokenManager()
        self._reactor = ThreadedReactor()
        self._reactor.listen_udp(self._my_node.addr[1], self._on_datagram_received)
        self._querier = Querier(self._my_id)
        bootstrap_nodes = self.loaded_nodes or BOOTSTRAP_NODES
        del self.loaded_nodes
        self._routing_m = routing_m_mod.RoutingManager(self._my_node, bootstrap_nodes)
        self._lookup_m = lookup_m_mod.LookupManager(self._my_id)
        current_time = time.time()
        self._next_maintenance_ts = current_time
        self._next_save_state_ts = current_time + SAVE_STATE_DELAY
        self._running = False 
開發者ID:alesnav,項目名稱:p2ptv-pi,代碼行數:22,代碼來源:controller.py

示例2: trackerInstance

# 需要導入模塊: import tracker [as 別名]
# 或者: from tracker import Tracker [as 別名]
def trackerInstance(url):
    item = Tracker(url)
    data = ItemData(url)

    style.use("fivethirtyeight")
    item.graph()

    if item.compare_prices() == 'below':
        print(f'{item.price()} < ${item.target_price}\n')
        comms = Communication(item.title().strip(), url, item.price(), '$' + item.target_price)
        
        comms.sendEmail()
        comms.sendText()

        data.delFile()

    elif item.compare_prices() == 'above':
        print(f'{item.price()} > ${item.target_price}\n')

    elif item.compare_prices() == 'out-of-stock':
        print(f'{item.price()} > ${item.target_price} - Item is out of stock\n') 
開發者ID:Den4200,項目名稱:amazon-price-tracker,代碼行數:23,代碼來源:main.py

示例3: __init__

# 需要導入模塊: import tracker [as 別名]
# 或者: from tracker import Tracker [as 別名]
def __init__(self):
        self.prev_flight_data = None
        self.record = False
        self.tracking = False
        self.keydown = False
        self.date_fmt = '%Y-%m-%d_%H%M%S'
        self.speed = 50
        self.drone = tellopy.Tello()
        self.init_drone()
        self.init_controls()

        # container for processing the packets into frames
        self.container = av.open(self.drone.get_video_stream())
        self.vid_stream = self.container.streams.video[0]
        self.out_file = None
        self.out_stream = None
        self.out_name = None
        self.start_time = time.time()

        # tracking a color
        green_lower = (30, 50, 50)
        green_upper = (80, 255, 255)
        #red_lower = (0, 50, 50)
        # red_upper = (20, 255, 255)
        # blue_lower = (110, 50, 50)
        # upper_blue = (130, 255, 255)
        self.track_cmd = ""
        self.tracker = Tracker(self.vid_stream.height,
                               self.vid_stream.width,
                               green_lower, green_upper) 
開發者ID:Ubotica,項目名稱:telloCV,代碼行數:32,代碼來源:telloCV.py

示例4: main

# 需要導入模塊: import tracker [as 別名]
# 或者: from tracker import Tracker [as 別名]
def main():
	data = np.array(np.load('Detections.npy'))[0:10,0:150,0:150]
	tracker = Tracker(150, 30, 5)
	skip_frame_count = 0
	track_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0),
					(127, 127, 255), (255, 0, 255), (255, 127, 255),
					(127, 0, 255), (127, 0, 127),(127, 10, 255), (0,255, 127)]

	for i in range(data.shape[1]):
		centers = data[:,i,:]
		frame = createimage(512,512)
		if (len(centers) > 0):
			tracker.update(centers)
			for j in range(len(tracker.tracks)):
				if (len(tracker.tracks[j].trace) > 1):
					x = int(tracker.tracks[j].trace[-1][0,0])
					y = int(tracker.tracks[j].trace[-1][0,1])
					tl = (x-10,y-10)
					br = (x+10,y+10)
					cv2.rectangle(frame,tl,br,track_colors[j],1)
					cv2.putText(frame,str(tracker.tracks[j].trackId), (x-10,y-20),0, 0.5, track_colors[j],2)
					for k in range(len(tracker.tracks[j].trace)):
						x = int(tracker.tracks[j].trace[k][0,0])
						y = int(tracker.tracks[j].trace[k][0,1])
						cv2.circle(frame,(x,y), 3, track_colors[j],-1)
					cv2.circle(frame,(x,y), 6, track_colors[j],-1)
				cv2.circle(frame,(int(data[j,i,0]),int(data[j,i,1])), 6, (0,0,0),-1)
			cv2.imshow('image',frame)
			# cv2.imwrite("image"+str(i)+".jpg", frame)
			# images.append(imageio.imread("image"+str(i)+".jpg"))
			time.sleep(0.1)
			if cv2.waitKey(1) & 0xFF == ord('q'):
				cv2.destroyAllWindows()
				break

	# imageio.mimsave('Multi-Object-Tracking.gif', images, duration=0.08) 
開發者ID:mabhisharma,項目名稱:Multi-Object-Tracking-with-Kalman-Filter,代碼行數:38,代碼來源:object_track.py

示例5: addItem

# 需要導入模塊: import tracker [as 別名]
# 或者: from tracker import Tracker [as 別名]
def addItem():
    url = input('Item URL: ')
    item = Tracker(url)

    if ItemData(url).save() == 'already_exists':
        print('Item is already being tracked!')

    else:
        print(f'\n{item.title().strip()} has been added to the tracking list!') 
開發者ID:Den4200,項目名稱:amazon-price-tracker,代碼行數:11,代碼來源:main.py

示例6: mainLoop

# 需要導入模塊: import tracker [as 別名]
# 或者: from tracker import Tracker [as 別名]
def mainLoop():
    while True:
        option = input("""
        --------------------------------------------
        | Amazon Price Tracker v3.2 by Dennis Pham |
        |                                          |
        | 1. Run tracker                           |
        | 2. Add new item                          |
        | 3. Delete an item                        |
        | 4. List items                            |
        | 5. Exit                                  |
        |                                          |
        --------------------------------------------
        
             Option: """)                             

        if option == '1':
            trackerLoop()

        elif option == '2':
            addItem()

        elif option == '3':
            delItem()

        elif option == '4':
            print()
            for item, link in listItems().items():
                print(f'{item}: {link}')

        elif option == '5':
            exit()
        
        else:
            print('\nThis is not an option!') 
開發者ID:Den4200,項目名稱:amazon-price-tracker,代碼行數:37,代碼來源:main.py


注:本文中的tracker.Tracker方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。