projet-transversal/src/main.py

32 lines
497 B
Python
Raw Normal View History

2022-11-25 10:20:04 +00:00
import logging
2022-11-25 10:14:17 +00:00
import cv2
2022-11-26 18:23:02 +00:00
from environment import Environment
2022-11-25 10:14:17 +00:00
2022-11-25 10:20:04 +00:00
def main() -> None:
"""Main function."""
# open webcam
cap = cv2.VideoCapture(0)
2022-11-26 18:23:02 +00:00
# create env
env = Environment(cap)
2022-11-25 10:20:04 +00:00
2022-11-26 18:23:02 +00:00
# start env
env.start()
2022-11-25 10:20:04 +00:00
# close webcam
cap.release()
if __name__ == "__main__":
# setup logging format
logging.basicConfig(
2022-11-25 10:49:26 +00:00
level=logging.INFO,
2022-11-25 10:20:04 +00:00
format="%(asctime)s %(name)s %(levelname)-8s %(message)s",
datefmt="(%F %T)",
)
main()