Skip to content
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

feat: add key_line_3d and key_point_3d annotation objects and structures #135

Merged

Conversation

nehalmamgain
Copy link
Contributor

@nehalmamgain nehalmamgain commented Dec 6, 2022

This PR unblocks the DGP loader for 3D lane detection.
It adds the necesary structures for KeyLine3D and KeyPoint3D, along with tests.


This change is Reviewable

@nehalmamgain nehalmamgain force-pushed the feat/nehal/add-3d-keyline-and-keypoint branch 2 times, most recently from 3ae01c5 to 24295e2 Compare December 6, 2022 08:28
@nehalmamgain
Copy link
Contributor Author

CC: @wadimkehl
P.S. I've requested @tk-woven for support on merge (PR needs at least 1 approval).

Copy link
Collaborator

@tk-woven tk-woven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nehal! Just some minor things :)

Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @nehalmamgain)


dgp/annotations/key_line_3d_annotation.py line 34 at r1 (raw file):

                line, KeyLine3D
            ), f"Can only instantate an annotation from a list of KeyLine3D, not {type(line)}"
        self.linelist = linelist

Do we intent for users to access this "publicly," as something like 3d_anno_list.linelist? Similar for pointlist in KeyPoint3DAnnotationList.


dgp/annotations/key_line_3d_annotation.py line 113 at r1 (raw file):

    def render(self):
        """TODO: Batch rendering function for keylines."""

Can we please add attribution to this TODO? Same for the one in they keypoint 3D class. If it's not clear who should do this work, we can just remove the TODO (but leave the part about batch rendering).


dgp/utils/structures/key_line_3d.py line 8 at r1 (raw file):

import dgp.proto.annotations_pb2 as annotations_pb2

GENERIC_OBJECT_CLASS = 1

Without seeing how this is used, it's not clear that this is an ID. Could we call it GENERIC_OBJECT_CLASS_ID please? We could also add docs, but I think extending the name is enough. Same for the constant in the corresponding key point 3d file.


dgp/utils/structures/key_line_3d.py line 17 at r1 (raw file):

    ----------
    line: np.ndarray[np.float32]
        Array of N*3 floats describing keyline coordinates [x, y, z].

I don't remember if we use representations like N*3 elsewhere in DGP. Do you mean the equivalent of (N, 3)? If so, can we please use the latter representation? This would help document the incoming shape.


dgp/utils/structures/key_line_3d.py line 89 at r1 (raw file):

        """Serialize keyline to proto object.

        NOTE: Does not serialize class or instance information, just line geometry.

Let's remove NOTE: please, as docs are notes ;) Same for the docs in the corresponding key point 3d file.


tests/data/dgp/key_line_3d/scene_000000/rgb/lcm_25tm/000000000000000005.png line 0 at r1 (raw file):
Is there a way to reduce the file size from its current 1.2 MB and still have the image be useful? Basically as small as possible is preferred.

Copy link
Collaborator

@tk-woven tk-woven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+reviewer:@kuanleetri

Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @kuanleetri and @nehalmamgain)

@nehalmamgain
Copy link
Contributor Author

Thanks for your review! Making the changes.

Is there a way to reduce the file size from its current 1.2 MB and still have the image be useful? Basically as small as possible is preferred.

Let me just remove the image. The tests are for checking loading annotation, not loading images (those tests exist on this repo) so the image isn't needed.

@nehalmamgain
Copy link
Contributor Author

May I also ask reviewers for review on #136 ?

@kuanleetri Since PR authors cannot request reviewers on the PR itself (unless they have Write/Admin privileges), could you please also suggest if there is any existing workflow where PR authors can request for review.

@nehalmamgain nehalmamgain force-pushed the feat/nehal/add-3d-keyline-and-keypoint branch from 24295e2 to 1919a51 Compare December 7, 2022 02:43
Copy link
Contributor Author

@nehalmamgain nehalmamgain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 6 of 13 files reviewed, 6 unresolved discussions (waiting on @kuanleetri and @tk-woven)


dgp/annotations/key_line_3d_annotation.py line 34 at r1 (raw file):

Previously, tk-woven wrote…

Do we intent for users to access this "publicly," as something like 3d_anno_list.linelist? Similar for pointlist in KeyPoint3DAnnotationList.

Done.


dgp/annotations/key_line_3d_annotation.py line 113 at r1 (raw file):

Previously, tk-woven wrote…

Can we please add attribution to this TODO? Same for the one in they keypoint 3D class. If it's not clear who should do this work, we can just remove the TODO (but leave the part about batch rendering).

Done.


dgp/utils/structures/key_line_3d.py line 8 at r1 (raw file):

Previously, tk-woven wrote…

Without seeing how this is used, it's not clear that this is an ID. Could we call it GENERIC_OBJECT_CLASS_ID please? We could also add docs, but I think extending the name is enough. Same for the constant in the corresponding key point 3d file.

Done.


dgp/utils/structures/key_line_3d.py line 17 at r1 (raw file):

Previously, tk-woven wrote…

I don't remember if we use representations like N*3 elsewhere in DGP. Do you mean the equivalent of (N, 3)? If so, can we please use the latter representation? This would help document the incoming shape.

Right, I just wrote it like in Maths. Done.


dgp/utils/structures/key_line_3d.py line 89 at r1 (raw file):

Previously, tk-woven wrote…

Let's remove NOTE: please, as docs are notes ;) Same for the docs in the corresponding key point 3d file.

Done.


tests/data/dgp/key_line_3d/scene_000000/rgb/lcm_25tm/000000000000000005.png line at r1 (raw file):

Previously, tk-woven wrote…

Is there a way to reduce the file size from its current 1.2 MB and still have the image be useful? Basically as small as possible is preferred.

Done.

@nehalmamgain nehalmamgain requested review from tk-woven and removed request for kuanleetri December 7, 2022 02:46
@nehalmamgain
Copy link
Contributor Author

nehalmamgain requested review from tk-woven and removed request for kuanleetri

I clicked on re-request button for review for tk-woven, and this automatically removed @kuanleetri
This does not happen on our other development repos, and probably has to do with the same issue mentioned above.

@nehalmamgain nehalmamgain force-pushed the feat/nehal/add-3d-keyline-and-keypoint branch from 1919a51 to 9b69661 Compare December 7, 2022 02:51
Copy link
Collaborator

@tk-woven tk-woven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nehal! I've re-added Kuan. Things LGTM here, but as we only require 1 approval before merge, I'll defer to Kuan to approve since this involves a schema update.

Reviewed 6 of 7 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @kuanleetri)

@tk-woven tk-woven dismissed their stale review December 7, 2022 03:17

Dismissing my own review to not block merge upon others' approvals

@nehalmamgain
Copy link
Contributor Author

Thanks Tyler!
The schema has been merged previously. This PR is more so for plumbing and follows the structure of other objects existing on the repo.

@kuanleetri I would like to merge this by EOD (with comments address ofc) to unblock my experimentation. If any changes are needed later, I would be happy to address them in another PR.

Copy link
Collaborator

@tk-woven tk-woven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, sorry! Then, :lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @kuanleetri)

@tk-woven tk-woven merged commit 5fa6002 into TRI-ML:master Dec 7, 2022
@nehalmamgain
Copy link
Contributor Author

Thank you kindly! 🙇‍♀️

@nehalmamgain nehalmamgain deleted the feat/nehal/add-3d-keyline-and-keypoint branch December 7, 2022 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants