32 lines
497 B
Python
32 lines
497 B
Python
import logging
|
|
|
|
import cv2
|
|
|
|
from environment import Environment
|
|
|
|
|
|
def main() -> None:
|
|
"""Main function."""
|
|
# open webcam
|
|
cap = cv2.VideoCapture(0)
|
|
|
|
# create env
|
|
env = Environment(cap)
|
|
|
|
# start env
|
|
env.start()
|
|
|
|
# close webcam
|
|
cap.release()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# setup logging format
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s %(name)s %(levelname)-8s %(message)s",
|
|
datefmt="(%F %T)",
|
|
)
|
|
|
|
main()
|