How to use beep - 3 common examples

To help you get started, we’ve selected a few beep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matcom / autoexam / scanner.py View on Github external
#Get system camera in index 0
    source = ImageSource(args.camera)
    w, h = source.get_size()
    #Set document processing parameters and initialize scanner
    scanner = TestScanner(w, h, args.exams_file, show_image=True, double_check=True, debug = args.debug, poll = args.poll)

    tests = {}
    #While user does not press the q key
    while cv2.waitKey(1) & 0xFF != ord('q'):
        #Get the scan report of the source image
        report = scanner.scan(source)
        #if test recognized OK
        if report.success:
            if not report.test.id in tests:
                beep.beep()
                tests[report.test.id] = report.test
                print "Test ID:", unicode(report.test.id).encode("utf8")
                for i, q in enumerate(report.test.questions):
                    print "%d. %s"%(i+1, q)
                if len(report.test.warnings)>0:
                    print "Warnings:"
                    for w in report.test.warnings:
                        print "\t", w
            else:
                print "The test '%d' was already scanned."%report.test.id
        #if recognition went wrong print the reasons
        else:
            # show only the question detection errors and the
            # errors in the format of the qrcodes
            for e in [x for x in report.errors
                        if isinstance(x, QuestionError) or
github matcom / autoexam / autoexam.py View on Github external
while True:
        #While user does not press the q key if it is a camera
        if source.is_camera:
            if (cv2.waitKey(100) & 0xFF) == ord('q'):
                print('Camera finished!')
                break
        elif source.finished:
            print('Folder finished!')
            break

        #Get the scan report of the source image
        report = scanner.scan(source)
        #if test recognized OK
        if report.success:
            if not report.test.id in tests:
                beep.beep()
                tests[report.test.id] = report.test
                print "Test ID:", unicode(report.test.id).encode("utf8")
                for i, q in enumerate(report.test.questions):
                    print "%d. %s" % (i+1, q)
                if len(report.test.warnings) > 0:
                    print "Warnings:"
                    for w in report.test.warnings:
                        print "\t", w
                # on_scan(report)
                #this method appends the test results if the file exists...
                if args.autowrite:
                    scanresults.dump(tests, args.outfile, overwrite=False)
                    stats = get_stats(args.outfile)
                    stats_path = os.path.join(os.path.dirname(os.path.realpath(args.outfile)), "stats.json")
                    with open(stats_path, "wb") as stats_file:
                        json.dump(stats, stats_file, indent=4)
github r9kawai / ToyDroneWithAutopilotBarcodeReader / drone_ar_flight.py View on Github external
self.frame_p_m = int(round(time.time() * 1000))
        self.frame = None
        self.gray_frame = None
        self.detects = 0
        self.detect_t = 0

        self.ar_dict_name = cv2.aruco.DICT_6X6_250
        self.ar_dict = cv2.aruco.getPredefinedDictionary(self.ar_dict_name)

        self._marker_reset()

        self.code_latest = ''
        self.code_latest_rect = (0,0,0,0)
        self.code_latest_view = 0

        self.beep = Beep()

        self.font = ImageFont.truetype(TTFFONT,32)
        self.fontbold = ImageFont.truetype(TTFFONTBOLD,32)

beep

beep is a python package supporting Battery Estimation and Early Prediction of battery cycle life.

Apache-2.0
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Popular beep functions

Similar packages