def complete(): b = cv2.imencode('.png', image)[1].tostring() # card = Card.from_image(Config.OutputFormat, b) card = Card.from_json_file(_) if card is not None: def save(firstname=None, lastname=None, sid=None): print("Saving...") override = time.strftime( "%Y/%m/%d %H:%M", time.localtime(os.path.getctime(path))) if None in (firstname, lastname, sid): if not io.insert_record(Config.OutputFormat(), card, override): print("Not Saved") else: io.insert_row(Config.OutputFormat, "{} {}".format(firstname, lastname), sid, override) next() revised = output_card_to_image(card, image) w.update_result(card, cv_2_pil(revised), save, next)