-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi Input Support #36
Conversation
…ead of bare tensors
…put_sources, which tells the LuxonisModel which loader sub-elements it wants to load, and LoaderConfig has an images_name parameter which identifies the image-like input among the sub-elements for compatibility with visualizers etc.
…ng use of images_name.
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
I see that the MacOS tests fail for all open PRs, so opening this one as well. |
self._images_name = images_name | ||
|
||
@property | ||
def images_name(self) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this to maybe source_name
. It doesn't have to necessarily be images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also raising an error in case it's None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this to maybe source_name. It doesn't have to necessarily be images
Or do we always expect this to be an image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property images_name
I created due to compatibility with image loggers/visualizers, which expect some of the loader inputs to contain image-like objects which it can process in OpenCV, log as images, etc. Right now, the config.yaml
owner is responsible for setting this property for their custom multi-input logger so that the rest of the code knows which inputs are images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also raising an error in case it's None.
I moved the declaration of images_name
to the config, which has 'features'
as the value by default, so unless the user implements their custom loader overriding this property as None
, it should never be None
. Is that how you produced this scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that makes sense. Though I'd maybe rename it to image_source
or something like that.
…to code structure requirements. Added missing tests for evaluation, export, and inference.
Yeah, you can ignore the MacOS tests. The MacOS machines are running out of memory, I'm planning to fix it eventually, but it's low priority. |
Test Results 4 files 4 suites 1h 0m 47s ⏱️ Results for commit 9987d0d. ♻️ This comment has been updated with latest results. |
Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: Martin Kozlovsky <[email protected]>
Motivation
The goal is to support multi-input models and loaders in luxonis-train.
Examples
Multi-input loader
The loader simulates an input consisting of stereo images (left and right), disparity maps, and point clouds. It also identifies "left" as the primary image type, which can be used in visualizers.
Multi-input model
This model includes nodes such as FullBackbone, RGBDBackbone (processing left, right, and disparity inputs), and PointcloudBackbone (processing pointcloud inputs). It also features FusionNeck and FusionNeck2 for combining outputs from these backbones, and CustomSegHead1 and CustomSegHead2 which also make use of the different fusion necks and inputs. The model showcases our capability to handle intricate data fusion, multi-modal processing, and serving loader data to any node in the graph.
Test changes
Updated collate_fn test due to how inputs were changed from
Tensor
s todict[str, Tensor]
.Breaking changes
Changed the type of
original_in_shape
ofLuxonisModel
fromSize
todict[str, Size]
(multiple inputs), so any custom models making use of this will stop working. To resolve this, users can make use of the new structure like this.