-
-
Save daniellopez0708/db5faf949a8d75bfc6839e651ecec262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import needed modules | |
import os | |
import csv | |
import numpy as np | |
import logging | |
import logging.handlers | |
import math | |
import sys | |
import random | |
import numpy as np | |
import skvideo.io | |
import cv2 | |
import matplotlib.pyplot as plt | |
from IPython.display import HTML | |
from base64 import b64encode | |
# without this some strange errors happen | |
cv2.ocl.setUseOpenCL(False) | |
random.seed(123) | |
# setup logging | |
def init_logging(level=logging.INFO): | |
main_logger = logging.getLogger() | |
for hnd in main_logger.handlers: | |
main_logger.removeHandler(hnd) | |
formatter = logging.Formatter( | |
fmt='%(asctime)s.%(msecs)03d %(levelname)-8s [%(name)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S') | |
handler_stream = logging.StreamHandler(sys.stdout) | |
handler_stream.setFormatter(formatter) | |
main_logger.addHandler(handler_stream) | |
main_logger.setLevel(level) | |
return main_logger |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment