Skip to content

Conversation

@thedavidchu
Copy link
Collaborator

The branch name is a misnomer. Originally, I had intended to work on plotting the 2D line into 3D. That didn't happen of course.

@thedavidchu thedavidchu requested a review from Jason-Y000 May 29, 2022 02:07
@thedavidchu thedavidchu added the enhancement New feature or request label May 29, 2022
@thedavidchu
Copy link
Collaborator Author

With Minor Optimizations

Minor code changes to use more built-in functions

Preprocessing: 0.001771800000000212 s
Clustering: 0.026063999999999865 s
Group Clusters: 14.482513800000001 s
Plot Lines: 0.026463299999999634 s
Elapsed time: end - start=14.538866800000001 s

With Optimization

Mostly grouping the cluster plotting functions into one call

Preprocessing: 0.0018540000000002443 s
Clustering: 0.02762999999999982 s
Group Clusters: 0.001914999999999889 s
Fit Lanes: 0.002709400000000084 s
Total time: end - start=0.22954419999999987 s

@Jason-Y000
Copy link
Collaborator

What did you change exactly? I think the version in cv-integration is the most up-to-date at the moment. If you can point out your changes we can add it into cv-integration stuff I think

@thedavidchu
Copy link
Collaborator Author

In sort_by_cluster

  • type hints
  • converted list outputs into np.ndarrays
  • Replaced logic with a built-in function

In lane_fitting

  • type hints + consistently typed output
  • Replaced sorting functions with min/max

In main

  • Moves all the logic inside main to remove global vars
  • I moved the graphing to the end, so we can victories the cluster plotting
  • Replaced if-else chain for colours with a hash lookup. I also grouped the cluster plots so we only have to do this lookup once per cluster
  • Added timing in if-statements
  • return the lane line fit
  • I moved the y-axis flipping to outside the for-loop so it works for even-numbers of clusters too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants