@@ -621,9 +621,6 @@ def main():
621
621
yolo8OpenvinoVerification_Thread .__verifyConf__ = yoloVerifyConf
622
622
623
623
# *** setup and start Coral AI threads
624
- # Might consider moving this into the thread function.
625
- ### Setup Coral AI
626
- # initialize the labels dictionary
627
624
if nCoral is True :
628
625
print ("\n [INFO] starting Coral TPU AI Thread ..." )
629
626
client .publish ("AI/Status" , "Starting Coral TPU thread." , 2 , True )
@@ -643,11 +640,13 @@ def main():
643
640
while Coral_TPU_Thread .__Thread__ is False :
644
641
sleepCount += 1
645
642
time .sleep (1.0 )
646
- if sleepCount >= 15 :
643
+ client .publish ("AI/Status" , "Coral TPU Thread is starting " + str (sleepCount ), 2 , True )
644
+ if sleepCount >= 30 :
647
645
client .publish ("AI/Status" , "[ERROR] Coral_TPU_Thread failed to start, exiting..." , 2 , True )
648
646
print ('[ERROR] Coral_TPU_Thread failed to start, exiting...' )
649
647
QUIT = True
650
- client .publish ("AI/Status" , "Coral TPU thread is running." , 2 , True )
648
+ if not QUIT :
649
+ client .publish ("AI/Status" , "Coral TPU thread is running." , 2 , True )
651
650
652
651
# ** setup and start openvino CPU AI thread.
653
652
if nCPUthreads is True :
@@ -680,16 +679,18 @@ def main():
680
679
client .publish ("AI/Status" , "Converting MobilenetSSD_v2 working..." , 2 , True )
681
680
else :
682
681
client .publish ("AI/Status" , "Converting MobilenetSSD_v2 still working..." , 2 , True )
683
- toggle = (toggle + 1 )% 2
682
+ toggle = (toggle + 1 )% 2
683
+ client .publish ("AI/Status" , "OpenVINO CPU Thread is starting " + str (sleepCount ), 2 , True )
684
684
if sleepCount >= 30 :
685
685
client .publish ("AI/Status" , "[ERROR] OpenVINO_SSD_Thread failed to start, exiting..." , 2 , True )
686
686
print ('[ERROR] OpenVINO_SSD_Thread failed to start, exiting...' )
687
687
QUIT = True
688
- client .publish ("AI/Status" , "OpenVINO MobilenetSSD_v2 thread is running." , 2 , True )
688
+ if not QUIT :
689
+ client .publish ("AI/Status" , "OpenVINO MobilenetSSD_v2 thread is running." , 2 , True )
689
690
690
691
691
692
if OVyolo8_verify :
692
- # Start dopenvino yolo8 thread
693
+ # Start openvino yolo8 thread
693
694
print ("\n [INFO] OpenVINO yolo_v8 verification thread is starting ... " )
694
695
client .publish ("AI/Status" , "Starting OpenVINO yolo8 verification thread." , 2 , True )
695
696
yolo8ov = list ()
@@ -700,6 +701,7 @@ def main():
700
701
while yolo8OpenvinoVerification_Thread .__Thread__ is False :
701
702
sleepCount += 1
702
703
time .sleep (1.0 )
704
+ client .publish ("AI/Status" , "OpenVINO yolo8 verification thread starting " + str (sleepCount ), 2 , True )
703
705
while yolo8OpenvinoVerification_Thread .__CONVERTING__ is True :
704
706
if sleepCount == 1 :
705
707
print ('Downloading and converting yolo8 openvino model, be patient!' )
@@ -711,13 +713,15 @@ def main():
711
713
client .publish ("AI/Status" , "Converting openvino yolo8 working..." , 2 , True )
712
714
else :
713
715
client .publish ("AI/Status" , "Converting openvino yolo8 still working..." , 2 , True )
714
- toggle = (toggle + 1 )% 2
716
+ toggle = (toggle + 1 )% 2
717
+ client .publish ("AI/Status" , "OpenVINO yolo8 verification starting " + str (sleepCount ), 2 , True )
715
718
if sleepCount >= 30 :
716
719
print ('[ERROR] OpenVINO yolo8 thread failed to start, exiting...' )
717
720
client .publish ("AI/Status" , "[ERROR] OpenVINO yolo8 thread failed to start, exiting..." , 2 , True )
718
721
QUIT = True
719
- print ("[INFO] OpenVINO yolo_v8 verification thread is running. " )
720
- client .publish ("AI/Status" , "OpenVINO yolo8 verification thread is running." , 2 , True )
722
+ if not QUIT :
723
+ print ("[INFO] OpenVINO yolo_v8 verification thread is running. " )
724
+ client .publish ("AI/Status" , "OpenVINO yolo8 verification thread is running." , 2 , True )
721
725
722
726
723
727
if yolo8_verify or TPUyolo8_verify :
@@ -747,7 +751,8 @@ def main():
747
751
client .publish ("AI/Status" , "Converting yolo8 model working..." , 2 , True )
748
752
else :
749
753
client .publish ("AI/Status" , "Converting yolo8 still working..." , 2 , True )
750
- toggle = (toggle + 1 )% 2
754
+ toggle = (toggle + 1 )% 2
755
+ client .publish ("AI/Status" , "Yolo8 verification thread starting " + str (sleepCount ), 2 , True )
751
756
if sleepCount >= 30 :
752
757
if TPUyolo8_verify :
753
758
client .publish ("AI/Status" , "[ERROR] TPU yolo8 thread failed to start, exiting..." , 2 , True )
@@ -756,12 +761,14 @@ def main():
756
761
client .publish ("AI/Status" , "[ERROR] CUDA yolo8 thread failed to start, exiting..." , 2 , True )
757
762
print ('[ERROR] CUDA yolo8 thread failed to start, exiting...' )
758
763
QUIT = True
759
- if TPUyolo8_verify :
760
- client .publish ("AI/Status" , "Ultralytics TPU yolo8 verification thread is running." , 2 , True )
761
- else :
762
- # Start Ultralytics yolo8 verification thread
763
- client .publish ("AI/Status" , "Ultralytics CUDA yolo8 verification thread is running." , 2 , True )
764
- print ("[INFO] Ultralytics yolo_v8 verification thread is running. " )
764
+ if not QUIT :
765
+ if TPUyolo8_verify :
766
+ client .publish ("AI/Status" , "Ultralytics TPU yolo8 verification thread is running." , 2 , True )
767
+ print ("[INFO] Ultralytics TPU yolo_v8 verification thread is running. " )
768
+ else :
769
+ # Start Ultralytics yolo8 verification thread
770
+ client .publish ("AI/Status" , "Ultralytics CUDA yolo8 verification thread is running." , 2 , True )
771
+ print ("[INFO] Ultralytics CUDA yolo_v8 verification thread is running. " )
765
772
766
773
767
774
0 commit comments