'from_depthai' conversion function added#909
'from_depthai' conversion function added#909CodeRic28 wants to merge 2 commits intoroboflow:developfrom
Conversation
|
Hi @CodeRic28 👋🏻 ! I'm very sorry for the late response. I was a bit overwhelmed with responsibilities not related to supervision. I like the idea of adding Luxonis support. I left a few comments under your PR. |
| ) | ||
|
|
||
| @classmethod | ||
| def from_depthai(cls, depthai_results) -> Detections: |
There was a problem hiding this comment.
Could we rename it from from_depthai to from_luxonis? I think the Luxonis brand is much more recognizable than DepthAI. To be honest, I did not know what DepthAI is, but I'm absolutely familiar with Luxonis.
|
|
||
| Args: | ||
| depthai_results (depthai/resources/nn): | ||
| The output Detections instance from DepthAI |
There was a problem hiding this comment.
Please add . at the end of the sentence.
| results = sv.Detections.from_depthai(detection) | ||
| tracks = tracker.update_with_detections(results) | ||
| ``` | ||
| # For device and nn setup, refer: |
There was a problem hiding this comment.
I'd move this to the very top of the docstring.
| Returns: | ||
| Detections: A new Detections object. | ||
|
|
||
| Example: |
There was a problem hiding this comment.
Could we make this example a bit simpler? Maybe show how it works for a single frame. For sure, drop tracker.
Description
Added 'from_depthai()' function to convert depthai detection class to supervision detection class. Returns a new detections object. This can now be used in any of the supervision functions for detections or tracking.
Dependencies
depthai
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
Initially I added this function to
venv/lib/python3.11/site-packages/supervision/detection/core.pyand used the example code to convertdepthaidetections result tosupervisionformat. I then used the result to apply supervision's ByteTracker. I created a PPE detection application that used Oak-1 device for real-time detection and deployment.Any specific deployment considerations
No
Docs