Skip to content

Conversation

Ardorax
Copy link
Contributor

@Ardorax Ardorax commented Jul 19, 2022

Scene flow class

Create scene flow by calling the class with a file path, a tensor or a ndarray.

If you have optical flow, depth at time T and T + 1 and the camera intrinsic. You can create scene flow with the class method from_optical_flow. It handle the creation of the occlusion mask if some parameters have one.

Ardorax added 2 commits July 18, 2022 15:11
+ Scene flow class on aloscene.
+ Classmethod to create sceneflow from optical flow, depth and intrinsic.
+ Function to load scene flow from a numpy file.

Signed-off-by: Valentin Dury <[email protected]>
- For loop in points 3d to generate scene flow.
+ Numpy operation to calculate the scene flow.
+ Vertical and horizontal flip functions.

Signed-off-by: Valentin Dury <[email protected]>
@Ardorax Ardorax added enhancement New feature or request good first issue Good for newcomers aloscene aloscene labels Jul 19, 2022
@Ardorax Ardorax requested a review from jsalotti July 19, 2022 09:05
+ Use loop to correctly create scene flow
- Flip on Z axis.

Signed-off-by: Valentin Dury <[email protected]>
@jsalotti jsalotti marked this pull request as draft July 20, 2022 07:33
+ Translate every point a T+1 by the optical flow.
+ Numpy array indexing instead of for loop.

Signed-off-by: Valentin Dury <[email protected]>
Ardorax added 3 commits July 21, 2022 17:23
+ Get the value of the scene flow with the mean of the 4 points around.
+ Reshape directly from the array.
+ Better name for variables.

Signed-off-by: Valentin Dury <[email protected]>
+ Scene flow classmethod 'from_optical_flow' can now handle batch dimension.

Signed-off-by: Valentin Dury <[email protected]>
+ Use grid_sample function to calculate scene flow to have a better precision than with the mean value.

Signed-off-by: Valentin Dury <[email protected]>
@Ardorax Ardorax requested a review from jsalotti July 25, 2022 12:37
@Ardorax Ardorax self-assigned this Jul 25, 2022
Ardorax added 2 commits July 27, 2022 10:11
- Error in calculation
+ Use only pytorch to create scene flow.

Signed-off-by: Valentin Dury <[email protected]>
+ Compute the scene flow occlusion from the parameters occlusion and and calculation method.

Signed-off-by: Valentin Dury <[email protected]>
Ardorax added 2 commits July 28, 2022 13:06
+ Occlusion can be None if any parameters have occlusion.
+ Grid sample precision is verify only with occlusion of the depth at T+1.
+ Rename parameter 'mode' to 'sampling' and add it in the docstring.

Signed-off-by: Valentin Dury <[email protected]>
- Useless operation.

Signed-off-by: Valentin Dury <[email protected]>
@Ardorax Ardorax marked this pull request as ready for review July 28, 2022 11:28
@Ardorax Ardorax requested a review from jsalotti July 28, 2022 11:29
@Ardorax Ardorax requested review from Data-Iab and thibo73800 July 28, 2022 11:31
Ardorax added 3 commits July 28, 2022 14:36
+ Move 'load_scene_flow' to 'aloscene/io/flow'.
+ Better docstring
+ Test batch dimentions existance with the tensor names.

Signed-off-by: Valentin Dury <[email protected]>
+ Verify if file extension is .npy.
+ Better docstring.
+ Occlusion is of type None by default.

Signed-off-by: Valentin Dury <[email protected]>
- Useless variable.

Signed-off-by: Valentin Dury <[email protected]>
@Ardorax Ardorax requested a review from Data-Iab July 28, 2022 12:58
Copy link
Collaborator

@Data-Iab Data-Iab left a comment

Choose a reason for hiding this comment

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

good job

@thibo73800
Copy link
Contributor

thibo73800 commented Jul 28, 2022

Thanks, can you add a quick/simple example on how to use it in the description ? So that I can add it to the next release ? I'll merge after @Ardorax

@thibo73800 thibo73800 merged commit 1aa27b5 into master Jul 28, 2022
@thibo73800 thibo73800 deleted the scene_flow branch July 28, 2022 14:38
@Ardorax Ardorax restored the scene_flow branch August 4, 2022 13:55
@Ardorax Ardorax deleted the scene_flow branch August 4, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aloscene aloscene enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants