Conversation
✅ Deploy Preview for viseron canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR adds config reload support to the darknet object detection component, enabling the component to be cleanly unloaded and re-loaded at runtime when the configuration changes.
Changes:
- Adds an
unload()top-level function to gracefully stop the darknet worker and remove it fromvis.data - Adds an abstract
stop()method toBaseDarknetwith concrete implementations inDarknetDNN(delegating toSubProcessWorker.stop) andDarknetNative(delegating toChildProcessWorker.stop) - Moves
numpyandViseronimports underTYPE_CHECKINGguard, and adds type annotations to several abstract and concrete methods
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| @abstractmethod | ||
| def preprocess(self, frame): | ||
| def preprocess(self, frame: np.ndarray) -> np.ndarray | bytes: |
There was a problem hiding this comment.
The BaseDarknet.preprocess abstract method's frame parameter now has a np.ndarray type annotation, and DarknetDNN.preprocess was also updated in this PR. However, DarknetNative.preprocess at line 447 still has an untyped frame parameter (def preprocess(self, frame) -> bytes:). This PR introduced the type annotation to the base class and one subclass, but missed updating DarknetNative.preprocess to be consistent.
| def preprocess(self, frame: np.ndarray) -> np.ndarray | bytes: | |
| def preprocess(self, frame: Any) -> np.ndarray | bytes: |
No description provided.