File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
video_imageclassification Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 77import inspect
88import threading
99import socket
10+ import numpy as np
1011from typing import Callable
1112
1213from websockets .sync .client import connect , ClientConnection
@@ -179,6 +180,11 @@ def camera_loop(self):
179180 tcp_socket .connect ((self ._host , 5050 ))
180181 logger .info (f"TCP connection established to { self ._host } :5050" )
181182
183+ # Send a priming frame to initialize the EI pipeline and its web server
184+ frame = np .zeros ((320 , 320 , 3 ), dtype = np .uint8 )
185+ jpeg_frame = compress_to_jpeg (frame )
186+ tcp_socket .sendall (jpeg_frame .tobytes ())
187+
182188 while self ._is_running .is_set ():
183189 try :
184190 frame = self ._camera .capture ()
Original file line number Diff line number Diff line change 77import inspect
88import threading
99import socket
10+ import numpy as np
1011from typing import Callable
1112
1213from websockets .sync .client import connect , ClientConnection
@@ -171,6 +172,11 @@ def camera_loop(self):
171172 tcp_socket .connect ((self ._host , 5050 ))
172173 logger .info (f"TCP connection established to { self ._host } :5050" )
173174
175+ # Send a priming frame to initialize the EI pipeline and its web server
176+ frame = np .zeros ((320 , 320 , 3 ), dtype = np .uint8 )
177+ jpeg_frame = compress_to_jpeg (frame )
178+ tcp_socket .sendall (jpeg_frame .tobytes ())
179+
174180 while self ._is_running .is_set ():
175181 try :
176182 frame = self ._camera .capture ()
You can’t perform that action at this time.
0 commit comments