ricky/merge conflicts 3.0 beta and 3.0#325
ricky/merge conflicts 3.0 beta and 3.0#325riccardosavorgnan wants to merge 16 commits into3.0_betafrom
Conversation
Authored by vinitsky.eugene@gmail.com
* Make SDC agent 0 and make sure it is always intialized and controlled * Oops little fix * Small fix: Make sure to increment num_actors. * Make SDC agent 0 and make sure it is always intialized and controlled * Oops little fix * Small fix: Make sure to increment num_actors. --------- Co-authored-by: Daphne Cornelisse <cor.daphne@gmail.com>
* Fix incorrect argument name. * Small revert. * Incorporate PR feedback.
* quick commit so you can read the code * Improve naming of sampling argument to better describe its function. * Ensure that initialization works with Carla maps or other, when sdc_index=-1. * Simplify CARLA compatibility * Replace num_maps by wosac_num_maps in all the eval scripts * Comment about random baseline. * Bug fix: do not reweight by the total weight (0.95). * Add this back for now. * Delete agent shrinking code. * Ignore ttc metric when agents are not vehicles * Update WOSAC weights to align with 2024 challenge since we don't have the traffic light metric. * Update table * Revert MAX_AGENTS to original. * Update formatting. --------- Co-authored-by: Wael Boumediene Doulazmi <wbd2016@cs713.hpc.nyu.edu> Co-authored-by: Waël Doulazmi <waeldoulazmi@gmail.com>
* Visualizer and control mode, init mode config description updates in docs * Fix Wrong names in control modes * add configs to drive.c, init_only_controlled and demo bug fixes, fix tables in docs * minor fix * Remove control_tracks_to_predict in another place
… of a Sum, it makes way more sense now (#277)
* Step 0: Adding the scenario_id in the Drive Struct and loading it in the Wosac bindings - Requires to recompile the maps though - Didn't think about CARLA compatibility yet Next steps: - Do the same work with track_ids (should be easy) - Adapt the SMART evaluation code (I hope easy as well) * Step 2: Give the real WOMD ids in the evaluator bindings. Also give is_track_to_predict as a bool. Next step: update the import trajectories evaluations script. * Evaluate imported trajectories is way better now * Warning in evaluate_imported_trajectories * Update the map_000.bin file * Checked that CARLA is still fine, removed comment
* Improve random map resampling code. * Refactor env: Create separate resampling function. * Works with wosac_use_map_as_resampling_target = False. * More elegant and clean solution to map resampling. * Clean up. * Put batch iteration in the WOSACEvaluator class to avoid repetition (keep puffer code clean). * Improve naming. * Clean up code and drop duplicates. * Fix util functions so that we can run wosac during training. * Log more metrics to wandb. * Remove unused variable map_idex. * Fix human replay eval. * Drop last scenario from batch as a safety measure.
Greptile SummaryThis PR merges a large batch of improvements from Key changes:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant PL as pufferl.py (eval)
participant E as WOSACEvaluator
participant VE as VecEnv (Drive)
participant C as C Simulator
PL->>E: evaluate(args, vecenv, policy)
loop Until target scenarios covered OR max_batches
E->>VE: resample_maps() [batch > 0]
VE->>C: vec_close / binding.shared / env_init / vec_reset
E->>VE: collect_ground_truth_trajectories()
VE->>C: vec_get_global_ground_truth_trajectories()<br/>(x, y, z, heading, valid, id, is_vehicle, is_track_to_predict, scenario_id)
C-->>VE: GT trajectory arrays
alt eval_mode == "policy"
E->>VE: collect_simulated_trajectories(policy)
VE->>C: vec_step (num_rollouts × sim_steps)
C-->>VE: simulated x/y/heading
else eval_mode == "ground_truth"
E->>E: repeat GT trajectories as simulated
end
E->>E: compute_metrics(gt, sim, agent_state, road_edges)
Note over E: avg log-likelihoods per scenario → exp → realism_meta_score
E->>E: track unique scenario_ids
end
E-->>PL: df_scene_level (per-scenario scores)
PL->>PL: df.mean() → aggregate metrics dict
PL->>PL: log to WandB
Last reviewed commit: b5adcd6 |
| #include "../env_config.h" | ||
| #include <string.h> | ||
| #include "../env_config.h" |
There was a problem hiding this comment.
Duplicate #include "../env_config.h"
env_config.h is included twice — once on line 4 and again on line 6. Although the header's #ifndef ENV_CONFIG_H guard prevents a double-definition compilation error, the second include is clearly an artifact from the merge and should be removed.
| #include "../env_config.h" | |
| #include <string.h> | |
| #include "../env_config.h" | |
| #include "drivenet.h" | |
| #include "error.h" | |
| #include "libgen.h" | |
| #include "../env_config.h" | |
| #include <string.h> |
| if not model_files: | ||
| print("No model files found for WOSAC evaluation. Running WOSAC with random policy.") | ||
| elif len(model_files) > 0: | ||
| latest_cpt = max(model_files, key=os.path.getctime) | ||
| cmd.extend(["--load-model-path", latest_cpt]) |
There was a problem hiding this comment.
Redundant elif len(model_files) > 0 condition
After the if not model_files: branch, model_files is guaranteed to be non-empty, so elif len(model_files) > 0 is always True at that point — it's dead conditional logic. Replacing it with a plain else: makes the intent clearer and avoids the misleading branch.
Additional Comments (1)
As a result, Fix by using kinematic_cols = [
"likelihood_linear_speed",
"likelihood_linear_acceleration",
"likelihood_angular_speed",
"likelihood_angular_acceleration",
]
interactive_cols = [
"likelihood_collision_indication",
"likelihood_distance_to_nearest_object",
"likelihood_time_to_collision",
]
map_cols = [
"likelihood_distance_to_road_edge",
"likelihood_offroad_indication",
]
df_scene_level["kinematic_metrics"] = df_scene_level[kinematic_cols].mean(axis=1)
df_scene_level["interactive_metrics"] = df_scene_level[interactive_cols].mean(axis=1)
df_scene_level["map_based_metrics"] = df_scene_level[map_cols].mean(axis=1) |
mainto2.0#256)