-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (26 loc) · 891 Bytes
/
main.py
File metadata and controls
31 lines (26 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from multiprocessing import Process, Queue
import sys
from examiner import examiner
from recorder import recorder
from server import server
import logging
from config import CAMERA_ON, SERVER_ON, RECORDER_ON
logging.basicConfig(level=logging.WARNING)
logging.getLogger('ultralytics').setLevel(logging.CRITICAL)
logging.getLogger('libpng').setLevel(logging.CRITICAL)
if __name__ == "__main__":
fqueue = Queue()
rqueue = Queue()
producer_process = Process(target=examiner, args=(fqueue, rqueue))
consumer_process = Process(target=server, args=(fqueue,))
recorder_process = Process(target=recorder, args=(rqueue,))
if CAMERA_ON:
producer_process.start()
if SERVER_ON:
consumer_process.start()
if RECORDER_ON:
recorder_process.start()
if CAMERA_ON:
producer_process.join()
if SERVER_ON:
consumer_process.join()