def uploadfile():
    filename = input(colored(" [system]: filename: ", "white"))
    flnm = filename
    time.sleep(1)
    if os.path.isfile(filename):
        print("")
        print(" [system]: size: ", str(os.path.getsize(filename)))
        asw = input(
            colored(
                " [system]: are u sure to send {} (y/n): ".format(filename),
                "white"))
        if asw == 'y':
            ################################
            suffix = '%(index)d/%(max)d [%(elapsed)d / %(eta)d / %(eta_td)s]'
            bar = PixelBar(" [system]: uploading ", suffix=suffix)
            for i in bar.iter(range(100)):
                sleep()
            ##################################
            ftp.storbinary('STOR ' + filename, open(filename, 'rb'))
            time.sleep(1.2)
            print("")
            print(colored(" [system]: file uploded", "white"))
            ftp.quit()
        else:
            print(" [system]: operartion aborted")
            ftp.quit()
    else:
        print(" [system]: ERROR ! no such file named {} exists.".format(
            filename))
Beispiel #2
0
            version='[v 1.0]',
            service_account_json_file='/Users/'
                                      'admin/Downloads/savvy-etching-254922-e6fda8dabd2c.json')
    except ImportError:
        pass


def sleep():
    t = 0.01
    t += t * random.uniform(-0.1, 0.1)  # Add some variance
    time.sleep(t)


suffix = '%(index)d/%(max)d [%(elapsed)d / %(eta)d / %(eta_td)s]'
bar = PixelBar('PROCESSING', suffix=suffix)
for i in bar.iter(range(150)):
    sleep()


"""VIDEO DETECTION LINE'S"""


cap = cv2.VideoCapture("test2.mp4")
while cap.isOpened():
    _, frame = cap.read()
    canny_image = canny(frame)
    cropped_image = region_of_interest(canny_image)
    # Угловой коээфициент
    lines = cv2.HoughLinesP(cropped_image, 2, np.pi / 180, 100, np.array([()]),
                            minLineLength=40,
                            maxLineGap=5)