-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain_jetson.py
27 lines (19 loc) · 920 Bytes
/
main_jetson.py
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
from core.event_handlers import ReadServiceEventHandler
from core.jetson.jetson_detector import JetsonObjectDetector
from core.jetson.model_loader import load_model
from common.event_bus.event_bus import EventBus
from common.utilities import logger
from core.models.detections import BaseDetector
from core.utilities import register_detect_service, EventChannels
def create_object_detector_model() -> BaseDetector:
model = load_model()
return JetsonObjectDetector(model)
def main():
register_detect_service('jetson_detection_service', 'detect_service_jetson-instance', 'The Jetson Object Detection Service®')
detector = create_object_detector_model()
handler = ReadServiceEventHandler(detector)
logger.info('jetson object detection service will start soon')
event_bus = EventBus(EventChannels.snapshot_in)
event_bus.subscribe_async(handler)
if __name__ == '__main__':
main()