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

Fix bug in 'intersect_w_triangle_batch' #95

Closed
wants to merge 17 commits into from

Conversation

yaio4109
Copy link
Contributor

@yaio4109 yaio4109 commented Mar 6, 2024

Make the function return the correct number of intersection points between the triangle and the ray.

@yaio4109
Copy link
Contributor Author

yaio4109 commented Mar 8, 2024

Adding more ray generating methods in raytracing module

@yaio4109
Copy link
Contributor Author

yaio4109 commented Mar 8, 2024

when testing function create_ray_from_grid_w_luminous_angle, but the Pytest failed the test. Becuase function rotate_points use different datatype in odak/learn/tools/transformation.py (ndarray) and odak/tools/transformation.py (tensor).

If you guys want to switch all the code with torch, I can help🫡.

@kaanaksit
Copy link
Owner

kaanaksit commented Mar 20, 2024

Thank you, @yaio4109 , for your continued support.

I am happy to incorporate these in the repository:

  • I can observe that the odak.learn.raytracing.boundary has gone through cosmetic changes, and odak.learn.raytracing.boundary.intersect_w_triangle_batch has gone through major changes.
  • An unused line is removed from odak.learn.tools.sample, thank you for doing that!
  • The unit tests, test/test_ray_create_ray_from_grid_w_luminous_angle.py, test/test_ray_create_ray_from_point_w_luminous_angle.py, test/test_ray_create_ray_from_all_pairs.py read well, but needs a tiny modification in their names by adding learn in their naming conventions (e.g., test/test_ray_create_ray_from_grid_w_luminous_angle.py -> test/test_learn_ray_create_ray_from_grid_w_luminous_angle.py).

However, these need revision in order to merge your code in the repository:

  • odak.raytracing.boundary which suppose to be pure CPU based now uses torch functions.
  • Same comments go for additions in the odak.raytracing.ray submodule.

Unfortunately, these create an issue. odak is designed to be a development platform but it is also an educational platform where a graduate student can read its code to develop their basic understanding on the matter both on old school Pythonic computations with Numpy and modern Pythonic computations with torch on the GPUs. Simply, put, we use Numpy when it is under odak and we use Torch when it is under odak.learn. I am unsure how to resolve this issue at this point and this is one of the reasons why I didn't merge this pull request.

@yaio4109
Copy link
Contributor Author

yaio4109 commented Jun 4, 2024

@kaanaksit, Sorry for late revision. I recall the original python code with numpy in raytracing module and move the function with torch into learn module.

@kaanaksit
Copy link
Owner

There were too many commits and I wanted to make sure that I have followed your updates as I merge it in the repository. Along the way, I had to delete the history and merge all your commits into a single commit to see what has really changed. The current version in the repository contains all your updates.

Thank you for your valuable contributions to odak! I would be happy to meet you if you have some availability for me. Please reach out to me using [email protected]. Thanks!

@kaanaksit kaanaksit closed this Jun 18, 2024
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