コード例 #1
0
def DetectPeople(cfgPath):
    print "hi"

    cam = Camera(cfgPath)

    app = QtWidgets.QApplication([])
    window = GUI(cfgPath)
    window.setCamera(cam)
    window.show()

    # Threading camera
    t_cam = ThreadCamera(cam)
    t_cam.start()

    # Threading GUI
    t_gui = ThreadGUI(window)
    t_gui.start()

    sys.exit(app.exec_())
コード例 #2
0
    t_network.setDaemon(True)  # setting daemon thread to exit
    t_network.start()

    tracker = Tracker(tracker_prop, tracker_lib_prop)
    # Threading Tracker
    t_tracker = ThreadTracker(tracker)
    t_tracker.setDaemon(True)
    t_tracker.start()

    window = GUI()
    cam.setGUI(window)
    cam.setLogger(logger_status)
    cam.setNetwork(network, t_network)
    cam.setTracker(tracker)
    cam.setNetworkParams(image_net_size, confidence)

    # Threading camera
    t_cam = ThreadCamera(cam)
    t_cam.setDaemon(True)
    t_cam.start()
    window.setNetwork(network, t_network)
    window.setTracker(tracker)

    if gui_cfg == 'on':
        window.show()
        # Threading GUI
        t_gui = ThreadGUI(window)
        t_gui.setDaemon(True)
        t_gui.start()

    sys.exit(window.app.exec_())
コード例 #3
0
while criteria() is False:
    print(i)

    img = find_img()
    time.sleep(1)
    link = img.get_attribute("src")
    links.append(link)
    next_page()

for i, link in enumerate(links):
    filename = "file" + str(i) + ".png"
    download_image(driver=driver, link=link, file_name=filename)
    crop(filename, (600, 0, 1200, 800), os.getcwd())

# link = seleniumq.find_image(imgs)
#
# script = "window.open({})".format(link)
#
# driver.execute_script(script)
# seleniumq.download_image(driver=driver, link=url, file_name="file{}.png".format(i))
#
# driver.save_screenshot("file{}.png".format(i))

create_pdf_from_images(["file{}.png".format(i) for i in range(amount_pages)])

driver.close()

if __name__ == '__main__':
    gui = GUI()
    gui.show()