-
Notifications
You must be signed in to change notification settings - Fork 684
Mtp baseline #291
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
Mtp baseline #291
Conversation
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.
@freddyaboulton Nice! I had a few small comments, but otherwise looks good.
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.
Looks good. I added a few comments.
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.
@freddyaboulton Some very light comments. Nothing stood out to me as incorrect, though I'd suggest testing a model with num_modes = 2
by overfitting on an image where you modify the gt so that you have the gt going in one direction ~50% of the time, and in a different direction the rest of the time. The model should learn 2 modes that coincide with the two gt trajectories.
@elenacorinagrigore Thanks for the review! |
* Adding PredictHelper class and unit tests (#280) * Adding PredictHelper class and unit tests * Adding docstring to convert_global_coords_to_local * Refactored get_future and get_past for agent and sample to reduce code duplication * Adding copyright header to source files * Adding typehint for _timestamp_for_sample * Raise error when seconds is negative. Ensure we do not return data when seconds is 0 * Cleanup * More formatting suggestions * Change argument format * Cleanup. Add _token suffix to variable names. * Moving tests/test_predict_helper.py to predict/tests/test_predict_helper.py * Fleshing out docstrings for PredictHelper * Adding return type for _get_past_or_future_for_sample Co-authored-by: holger-nutonomy <39502217+holger-nutonomy@users.noreply.github.com> * nuScenes-predict evaluation code (#283) * Adding PredictHelper class and unit tests * Adding docstring to convert_global_coords_to_local * Adding methods to helper to get velocity, hcr, and acceleration * Adding utility function to get instances in each split * Adding prediction scenes json file for determining train-val splits * Adding implementations of ConstantVelocityHeading and PhysicsOracle * Adding skeleton of eval/predict folder * Removing commoent from predict/models * Refactored get_future and get_past for agent and sample to reduce code duplication * Adding copyright header to source files * Adding typehint for _timestamp_for_sample * Raise error when seconds is negative. Ensure we do not return data when seconds is 0 * Adding Metrics, config, and eval_pipeline * sec_from_now is now a parameter for models * Fixing type hints in physics models and adding docstrings to Model classes * Adding dataroot param to compute_metrics * Adding data_root to do_inference * Adding dataroot as command line argument * Adding updated train val split for nuscenes-predict * Organize imports * Cleanup * Cleanup Models * Adding Attributes to Prediction dataclass docstring * Adding docstring to main method * Adding docstrings to baseline_model_inference.py * Adding docstrings to models.py * Fixing unittests that got deleted * Moving splits to eval/predict/splits.py * Adding docstrings to eval scripts. Fixing split import * Adding docstrings for do_inference.py * Adding data_root param to baseline_model_inference.py * Fixing bug in test Co-authored-by: holger-nutonomy <39502217+holger-nutonomy@users.noreply.github.com> * Mtp baseline (#291) * Adding implementation of MTP model and unit tests * Adding unit tests for the unimodal case * batch_losses are a list. Avoiding autograd errors this way * Adding script to see if mtp can overfit on a single example * Making modifications to mtp and run_mtp to use cuda * Adding comments to predict/config * Adding type hints for mtp * Fixing typo in trim_network_at_index * Format changes * Reorganize imports * Adding comments, fixing docstring * Adding default parameter to regression_loss_weight Co-authored-by: Holger Caesar <39502217+holger-nutonomy@users.noreply.github.com> * Module for Input Representation (#295) * Adding implementation of MTP model and unit tests * Adding unit tests for the unimodal case * batch_losses are a list. Avoiding autograd errors this way * Adding script to see if mtp can overfit on a single example * Making modifications to mtp and run_mtp to use cuda * Fix bug where the canvas_size was not retrieved from the patch_box * Adding get_map_name_from_sample_token to PredictHelper * Adding interface for input representation and static map layer representation * Removing get_2d_rotation function * Adding comments * Adding stress test for memory consumption of image generation * Fixing small typo bugs in run_image_generation * Adding option to predict helper to return the entire record as opposed to just xy * Adding unit tests for agents, combinators, static_layers, utils in input_representation * Adding comments and check for resolution > 0 Co-authored-by: Holger Caesar <39502217+holger-nutonomy@users.noreply.github.com> * Predict Challenge README (#296) * Adding first draft of README to explain rules of prediction challenge * Adding README for predict challenge * Removing link to eval ai since it is not set up yet * Fixing typos and clarifying general rules * Typo * Evaluation is now based on val set Co-authored-by: Holger Caesar <39502217+holger-nutonomy@users.noreply.github.com> * Add lane center lines to map json files (#301) * Adding code to draw lanes * Removing print statement * Adding arcline path utils module to discretize lanes * Adding ability to color by the yaw difference and splitting functions up a little bit * Adding unit tests * Adding lookup_polygon_layers list so that lane_connectors can be searched for but not rendered * Adding comments to arcline path util functions * Adding unit tests to map_expansion arcline_path_utils module * Adding more informative print statement to load_all_maps * Changing function names in discrete_path_utils * Added stylistic changes * Fixing type signatures and docstrings * Adding comment explaining how the pose is represented as a tuple Co-authored-by: Holger Caesar <39502217+holger-nutonomy@users.noreply.github.com> * Add Lane Connectivity Clean (#308) * Adding methods to map api for querying for connected_lanes * Loading the connectivity in its own function so the types are consistent * Extra spline utilities clean (#309) * Adding spline utilities * Adding tests * Calculating canvas_size in StaticLayerRasterizer so custom resolution can be used (#310) * Covernet baseline (#305) * Adding code to draw lanes * Removing print statement * Adding arcline path utils module to discretize lanes * Adding ability to color by the yaw difference and splitting functions up a little bit * Adding unit tests * Adding lookup_polygon_layers list so that lane_connectors can be searched for but not rendered * Adding comments to arcline path util functions * Adding unit tests to map_expansion arcline_path_utils module * Adding more informative print statement to load_all_maps * Adding backbones to own module. Adding covernet implementation * Covernet implementation and unittests * Adding unit tests for covernet and script to test if it can overfit on single image * Making covernet compatible with the GPU * Fixing copyright headers * Addressing Corina's comments * CV Baseline Bug (#317) * Fixing bug in ConstantVelocityHeading baseline * Fixing docstring for sampled_at in kinematics functions * Add off road rate metric (#318) * Adding convert_local_coords_to_global utility function * Fixing bug in ConstantVelocityHeading baseline * Implementing OffRoadRate metric. Updating metric deserialization and adding unit tests * Rewritting test for OffRoadRate to no longer use polygons * Setting the proper dataroot in _do_test * Removing polygon json files * Adding docstring and comment to load_drivable_area_polygons method * Tutorial + Finishing Touches (#325) * Adding is_valid method to prediction. Adding tutorial * Being clear that the model prediction must be in the global frame * Updating baseline_model_inference and compute_metrics * Adding prediction scenes split * Implementing MissRate metric * Correcting typos, adding docstrings, standardizing copyright * Adding docker_container and submission directories * Updating docker README * updating split * OffRoadRate uses the masks instead of polygons * Submission period starts april 1 * Removing PredictionConfig from config_factory * Removing PredictionConfig Import * Minor cleanup * Incorporating Holger's feedback v1 * Adding lane methods to nuscenes map demo * Changing hit to miss in nuScenes predict challenge * Organize imports * Cleanup, remove notebook outputs * Rename onenorth to nusc_map * Organize imports * Rewording of the tutorial * Cleanup * Removing MAINTAINER from docker file * Clearing map demo * Adding docstrings to metrics and other misc edits * Condensing cells in tutorial and adding a visualization * Changing the location of prediction_scenes.json * Adding checks the PhysicsOracle is called with the right amount of ground truth data * Fix markdown * Minor typo in README * Making docstrings consistent Co-authored-by: holger-nutonomy <39502217+holger-nutonomy@users.noreply.github.com> Co-authored-by: Holger Caesar <holger@nutonomy.com>
How to test:
nosetests predict/tests
andnosetests eval/predict/tests
run_mtp.py
tests whether the mtp model can overfit on a single example (for 1 or two modes) with the cpu or gpu@elenacorinagrigore Please verify the model implementation
@emwolff @holger-nutonomy your feedback is appreciated 😄