text
stringlengths
24
1.04M
metadata
stringlengths
233
497
### File: sledge/simulation/planner/pdm_planner/proposal/pdm_proposal.py from dataclasses import dataclass from typing import List from shapely.geometry import LineString from sledge.simulation.planner.pdm_planner.proposal.batch_idm_policy import BatchIDMPolicy from sledge.simulation.planner.pdm_planner.utils.pdm_pat...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/proposal/pdm_proposal.py", "license": "apache-2.0", "size": 3088}
### File: sledge/simulation/planner/pdm_planner/scoring/pdm_comfort_metrics.py from typing import Optional import numpy as np import numpy.typing as npt from scipy.signal import savgol_filter from sledge.simulation.planner.pdm_planner.utils.pdm_enums import StateIndex # TODO: Refactor & add to config # (1) ego_jerk...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/scoring/pdm_comfort_metrics.py", "license": "apache-2.0", "size": 13029}
### File: sledge/simulation/planner/pdm_planner/scoring/pdm_scorer.py import copy from typing import Dict, List, Optional import numpy as np import numpy.typing as npt from shapely import Point, creation from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.state_representation impo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/scoring/pdm_scorer.py", "license": "apache-2.0", "size": 22784}
### File: sledge/simulation/planner/pdm_planner/scoring/pdm_scorer_utils.py import numpy as np import numpy.typing as npt from shapely import LineString, Polygon from nuplan.common.actor_state.state_representation import StateSE2 from nuplan.common.actor_state.tracked_objects import TrackedObject from nuplan.planning....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/scoring/pdm_scorer_utils.py", "license": "apache-2.0", "size": 2314}
### File: sledge/simulation/planner/pdm_planner/simulation/batch_kinematic_bicycle.py import copy import numpy as np import numpy.typing as npt from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.state_representation import TimePoint from nuplan.common.actor_state.vehicle_parameter...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/simulation/batch_kinematic_bicycle.py", "license": "apache-2.0", "size": 736...
### File: sledge/simulation/planner/pdm_planner/simulation/batch_lqr.py from enum import IntEnum from typing import Optional, Tuple import numpy as np import numpy.typing as npt from nuplan.common.actor_state.vehicle_parameters import VehicleParameters, get_pacifica_parameters from nuplan.planning.simulation.simulati...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/simulation/batch_lqr.py", "license": "apache-2.0", "size": 21549}
### File: sledge/simulation/planner/pdm_planner/simulation/batch_lqr_utils.py from typing import Tuple import numpy as np import numpy.typing as npt from sledge.simulation.planner.pdm_planner.utils.pdm_geometry_utils import normalize_angle # Utils functions for BatchLQRTracker # Code re-written based on nuPlan's imp...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/simulation/batch_lqr_utils.py", "license": "apache-2.0", "size": 11645}
### File: sledge/simulation/planner/pdm_planner/simulation/pdm_simulator.py import numpy as np import numpy.typing as npt from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.state_representation import TimeDuration, TimePoint from nuplan.planning.simulation.simulation_time_controlle...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/simulation/pdm_simulator.py", "license": "apache-2.0", "size": 3354}
### File: sledge/simulation/planner/pdm_planner/utils/graph_search/bfs_roadblock.py from collections import deque from typing import Dict, List, Optional, Tuple, Union from nuplan.common.maps.abstract_map import AbstractMap from nuplan.common.maps.abstract_map_objects import RoadBlockGraphEdgeMapObject class Breadth...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/graph_search/bfs_roadblock.py", "license": "apache-2.0", "size": 5335}
### File: sledge/simulation/planner/pdm_planner/utils/graph_search/dijkstra.py from typing import Dict, List, Optional, Tuple import numpy as np from nuplan.common.maps.abstract_map_objects import LaneGraphEdgeMapObject, RoadBlockGraphEdgeMapObject class Dijkstra: """ A class that performs dijkstra's shortes...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/graph_search/dijkstra.py", "license": "apache-2.0", "size": 5977}
### File: sledge/simulation/planner/pdm_planner/utils/pdm_array_representation.py from typing import List import numpy as np import numpy.typing as npt import shapely from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.state_representation import StateSE2, StateVector2D, TimePoint ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/pdm_array_representation.py", "license": "apache-2.0", "size": 7855}
### File: sledge/simulation/planner/pdm_planner/utils/pdm_emergency_brake.py from typing import Optional import numpy as np import numpy.typing as npt from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.state_representation import StateSE2, StateVector2D, TimePoint from nuplan.comm...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/pdm_emergency_brake.py", "license": "apache-2.0", "size": 5431}
### File: sledge/simulation/planner/pdm_planner/utils/pdm_enums.py from enum import IntEnum class StateIndex: """Index mapping for array representation of ego states.""" _X = 0 _Y = 1 _HEADING = 2 _VELOCITY_X = 3 _VELOCITY_Y = 4 _ACCELERATION_X = 5 _ACCELERATION_Y = 6 _STEERING_AN...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/pdm_enums.py", "license": "apache-2.0", "size": 3528}
### File: sledge/simulation/planner/pdm_planner/utils/pdm_geometry_utils.py from typing import List import numpy as np import numpy.typing as npt from nuplan.common.actor_state.state_representation import StateSE2 from sledge.simulation.planner.pdm_planner.utils.pdm_enums import SE2Index def normalize_angle(angle)...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/pdm_geometry_utils.py", "license": "apache-2.0", "size": 3368}
### File: sledge/simulation/planner/pdm_planner/utils/pdm_path.py from typing import Any, List, Union import numpy as np import numpy.typing as npt from scipy.interpolate import interp1d from shapely.creation import linestrings from shapely.geometry import LineString from shapely.ops import substring from nuplan.comm...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/pdm_path.py", "license": "apache-2.0", "size": 3586}
### File: sledge/simulation/planner/pdm_planner/utils/route_utils.py from typing import Dict, List, Tuple import numpy as np from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.state_representation import StateSE2 from nuplan.common.maps.abstract_map import AbstractMap from nuplan....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/planner/pdm_planner/utils/route_utils.py", "license": "apache-2.0", "size": 9466}
### File: sledge/simulation/scenarios/sledge_scenario/sledge_scenario.py from __future__ import annotations # import warnings from pathlib import Path from typing import Any, Generator, List, Optional, Set, Tuple, Type, cast import numpy as np from shapely.geometry import Point from nuplan.planning.scenario_builder....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/scenarios/sledge_scenario/sledge_scenario.py", "license": "apache-2.0", "size": 13495}
### File: sledge/simulation/scenarios/sledge_scenario/sledge_scenario_utils.py from typing import List, Optional, Tuple import numpy as np import numpy.typing as npt import networkx as nx from nuplan.common.actor_state.agent import Agent from nuplan.common.actor_state.state_representation import StateSE2 from nuplan....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/simulation/scenarios/sledge_scenario/sledge_scenario_utils.py", "license": "apache-2.0", "size": 11691}
### File: sledge/sledgeboard/base/base_tab.py import logging import pathlib from typing import Any, List, Optional from bokeh.document.document import Document from bokeh.models import CheckboxGroup, MultiChoice from bokeh.plotting.figure import Figure from sledge.sledgeboard.base.data_class import SelectedMetricStat...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/base/base_tab.py", "license": "apache-2.0", "size": 9621}
### File: sledge/sledgeboard/base/data_class.py from __future__ import annotations import pathlib import pickle from dataclasses import dataclass from typing import Dict, List, Optional from nuplan.common.utils.io_utils import save_object_as_pickle from nuplan.planning.metrics.metric_dataframe import MetricStatistics...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/base/data_class.py", "license": "apache-2.0", "size": 4258}
### File: sledge/sledgeboard/base/experiment_file_data.py import logging from collections import defaultdict from dataclasses import dataclass, field from pathlib import Path from typing import Any, Dict, List import pandas as pd from bokeh.palettes import Dark2, Pastel1, Pastel2, Set1, Set2, Set3 from nuplan.plannin...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/base/experiment_file_data.py", "license": "apache-2.0", "size": 13306}
### File: sledge/sledgeboard/base/plot_data.py from __future__ import annotations import abc import threading from dataclasses import dataclass, field from typing import Any, Dict, List, NamedTuple, Optional, Union import numpy as np from bokeh.document import Document from bokeh.models import Button, ColumnDataSourc...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/base/plot_data.py", "license": "apache-2.0", "size": 44393}
### File: sledge/sledgeboard/base/simulation_tile.py import concurrent.futures import json import logging import lzma import math import os import pathlib import pickle import threading import time from concurrent.futures import ThreadPoolExecutor from functools import partial from pathlib import Path from typing impor...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/base/simulation_tile.py", "license": "apache-2.0", "size": 41940}
### File: sledge/sledgeboard/resource/css/cloud.css .cloud-input-form { display: None; position: fixed; left: 30%; top: 20%; z-index: 3000; } .cloud-tab-section { height: 95vh; width: 100%; } .cloud-tab-section a { color: #DE7061; } .col-extend-height { height: 100%; width: 100%; } .panel-body-...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/resource/css/cloud.css", "license": "apache-2.0", "size": 2850}
### File: sledge/sledgeboard/resource/css/histogram.css .histogram-setting-form { display: None; position: fixed; left: 30%; top: 20%; z-index: 3000; } .histogram-setting-form .modal-body .input-group .bk-root { width: 100%; } .histogram-bin-spinner { width: 100% !important; } .histogram-tab-modal-quer...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/resource/css/histogram.css", "license": "apache-2.0", "size": 1497}
### File: sledge/sledgeboard/resource/css/overview.css .overview-table { width: 100% !important; height: 100% !important; margin: auto !important; overflow-y: auto; overflow-x: auto; box-sizing: border-box !important; } .overview-table .slick-cell { border-right: 1px solid #ddd; word-wrap: break-word; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/resource/css/overview.css", "license": "apache-2.0", "size": 1504}
### File: sledge/sledgeboard/resource/css/scenario.css .panel-primary>.panel-heading { color: #fff; background-color: #DE7061; border-color: #DE7061; } .panel-primary { border-color: #DE7061; } .scenario-setting-form { display: None; position: fixed; left: 30%; top: 20%; z-index: 3000; } .scenario-...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/resource/css/scenario.css", "license": "apache-2.0", "size": 5417}
### File: sledge/sledgeboard/resource/scripts/utils.js function openTab(evt, tab_name) { var i, tab_content, header_bar_tab_btn; tab_content = document.getElementsByClassName("tab-content"); const navEles = document.getElementsByClassName("nav-item"); for (const navEle of navEles) { const navName = navEle....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "JavaScript", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/resource/scripts/utils.js", "license": "apache-2.0", "size": 2265}
### File: sledge/sledgeboard/resource/style.css body { font-family: "Open Sans", sans-serif; } .overlay { position: fixed; /* Positioning and size */ top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(128, 128, 128, 0.5); /* color */ display: none; /* making it hidden by default...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/resource/style.css", "license": "apache-2.0", "size": 4022}
### File: sledge/sledgeboard/sledgeboard.py import logging import os import signal from pathlib import Path from typing import Any, List, Optional import jinja2 from bokeh.application import Application from bokeh.application.handlers import FunctionHandler from bokeh.document.document import Document from bokeh.serve...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/sledgeboard.py", "license": "apache-2.0", "size": 8633}
### File: sledge/sledgeboard/style.py from typing import Any, Dict from nuplan.common.maps.abstract_map import SemanticMapLayer PLOT_PALETTE: Dict[str, str] = { "font_lavender_gray": "#adb9e3", "font_white": "#c9eaf1", "background_white": "#fafafa", "background_black": "#000000", "chart_green": "#...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/style.py", "license": "apache-2.0", "size": 6060}
### File: sledge/sledgeboard/tabs/cloud_tab.py import hashlib import logging import os import time from functools import partial from pathlib import Path from typing import Any, Dict, List, Optional import boto3 from bokeh.document.document import Document from bokeh.models import Button, ColumnDataSource, DataTable, ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/cloud_tab.py", "license": "apache-2.0", "size": 16115}
### File: sledge/sledgeboard/tabs/config/cloud_tab_config.py from dataclasses import dataclass from typing import Any, ClassVar, Dict, List, Optional from bokeh.models import HTMLTemplateFormatter @dataclass(frozen=True) class S3TabBucketNameConfig: """Config for s3 tab bucket name div tag.""" text: ClassVa...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/config/cloud_tab_config.py", "license": "apache-2.0", "size": 7226}
### File: sledge/sledgeboard/tabs/config/histogram_tab_config.py from dataclasses import dataclass from typing import Any, ClassVar, Dict, List, Optional, Tuple import numpy as np import numpy.typing as npt from bokeh.plotting import Figure from sledge.sledgeboard.style import PLOT_PALETTE @dataclass class Histogra...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/config/histogram_tab_config.py", "license": "apache-2.0", "size": 8989}
### File: sledge/sledgeboard/tabs/config/overview_tab_config.py from dataclasses import dataclass from typing import Any, ClassVar, Dict, List, Optional OVERVIEW_PLANNER_CHECKBOX_GROUP_NAME = 'overview_planner_checkbox_group' @dataclass class OverviewAggregatorData: """Aggregator metric data in the overview tab....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/config/overview_tab_config.py", "license": "apache-2.0", "size": 3263}
### File: sledge/sledgeboard/tabs/config/scenario_tab_config.py from dataclasses import dataclass, field from typing import Any, ClassVar, Dict, List, Tuple @dataclass(frozen=True) class ScenarioTabTitleDivConfig: """Config for the scenario tab title div tag.""" text: ClassVar[str] = "-" name: ClassVar[s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/config/scenario_tab_config.py", "license": "apache-2.0", "size": 2566}
### File: sledge/sledgeboard/tabs/configuration_tab.py import base64 import io import logging import pathlib import pickle from pathlib import Path from typing import Any, List from bokeh.document.document import Document from bokeh.models import CheckboxGroup, FileInput from sledge.sledgeboard.base.base_tab import B...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/configuration_tab.py", "license": "apache-2.0", "size": 5118}
### File: sledge/sledgeboard/tabs/histogram_tab.py import logging from collections import defaultdict from copy import deepcopy from typing import Any, Dict, List, Optional, Union import numpy as np import numpy.typing as npt from bokeh.document.document import Document from bokeh.layouts import column, gridplot, layo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/histogram_tab.py", "license": "apache-2.0", "size": 32509}
### File: sledge/sledgeboard/tabs/js_code/cloud_tab_js_code.py from dataclasses import dataclass from bokeh.models import ColumnDataSource, CustomJS, TextInput @dataclass(frozen=True) class S3TabLoadingJSCode: """JS code when loading.""" @classmethod def get_js_code(cls) -> CustomJS: """Get a cu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/js_code/cloud_tab_js_code.py", "license": "apache-2.0", "size": 3925}
### File: sledge/sledgeboard/tabs/js_code/histogram_tab_js_code.py from dataclasses import dataclass from bokeh.models.callbacks import CustomJS @dataclass(frozen=True) class HistogramTabLoadingJSCode: """JS when loading in the histogram tab.""" @classmethod def get_js_code(cls) -> CustomJS: """...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/js_code/histogram_tab_js_code.py", "license": "apache-2.0", "size": 1697}
### File: sledge/sledgeboard/tabs/js_code/scenario_tab_js_code.py from dataclasses import dataclass from bokeh.models.callbacks import CustomJS @dataclass(frozen=True) class ScenarioTabLoadingJSCode: """JS when loading simulation in the scenario tab.""" @classmethod def get_js_code(cls) -> CustomJS: ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/js_code/scenario_tab_js_code.py", "license": "apache-2.0", "size": 1655}
### File: sledge/sledgeboard/tabs/overview_tab.py import logging from collections import defaultdict from typing import Any, Dict, List import numpy as np from bokeh.document.document import Document from bokeh.models import ColumnDataSource, DataTable, TableColumn from sledge.sledgeboard.base.base_tab import BaseTab...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/overview_tab.py", "license": "apache-2.0", "size": 9776}
### File: sledge/sledgeboard/tabs/scenario_tab.py import logging import time from collections import defaultdict from dataclasses import dataclass from itertools import chain from math import ceil from typing import Any, Dict, List, Optional, cast import numpy as np import numpy.typing as npt import pandas from bokeh....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/tabs/scenario_tab.py", "license": "apache-2.0", "size": 54638}
### File: sledge/sledgeboard/templates/index.html <!DOCTYPE html> <html lang="en"> {% extends base %} {% block head %} <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> {% block inner_head %} <link rel="stylesheet" href="resource/spectre.min.css" /> <link rel="stylesheet"...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/templates/index.html", "license": "apache-2.0", "size": 3576}
### File: sledge/sledgeboard/templates/tabs/cloud.html <!DOCTYPE html> <html lang="en"> <title>S3 Explorer</title> <head> <title>Cloud</title> </head> <div class="tab-content" id="cloud"> <div class="loading loading-lg" id="cloud-modal-loading"></div> <div class="modal-dialog cloud-input-form" id="c...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/templates/tabs/cloud.html", "license": "apache-2.0", "size": 5225}
### File: sledge/sledgeboard/templates/tabs/histogram.html <!DOCTYPE html> <html lang="en"> <div class="tab-content" id="histograms"> <div class="loading loading-lg" id="histogram-loading"></div> <div class="modal-dialog histogram-setting-form" id="histogram-setting-form"> <div class="modal-conte...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/templates/tabs/histogram.html", "license": "apache-2.0", "size": 3868}
### File: sledge/sledgeboard/templates/tabs/overview.html <!DOCTYPE html> <html lang="en"> <div class="tab-content" id="overview" style="display:block"> <div class="overview-section" id="overview-section"> <div class="col-lg-12 col-extend-height"> <div class="panel panel-primary dropzone pan...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/templates/tabs/overview.html", "license": "apache-2.0", "size": 1055}
### File: sledge/sledgeboard/templates/tabs/scenario.html <!DOCTYPE html> <html lang="en"> <div class="tab-content" id="scenarios"> <div class="loading loading-lg" id="scenario-loading"></div> <div class="modal-dialog scenario-setting-form" id="scenario-setting-form"> <div class="modal-content"> ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/templates/tabs/scenario.html", "license": "apache-2.0", "size": 10118}
### File: sledge/sledgeboard/utils/sledgeboard_cloud_utils.py from __future__ import annotations import io import logging import os import pickle from dataclasses import dataclass from datetime import datetime, timezone from pathlib import Path from typing import Any, Dict, Optional from urllib import parse import bo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/utils/sledgeboard_cloud_utils.py", "license": "apache-2.0", "size": 10776}
### File: sledge/sledgeboard/utils/sledgeboard_histogram_utils.py import logging from collections import defaultdict from typing import Dict, List, Optional, Tuple, Union import numpy as np import numpy.typing as npt import pandas as pd from bokeh.models import FactorRange from nuplan.planning.metrics.metric_datafram...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/utils/sledgeboard_histogram_utils.py", "license": "apache-2.0", "size": 12280}
### File: sledge/sledgeboard/utils/utils.py import logging from pathlib import Path from typing import List import pandas as pd from nuplan.planning.metrics.metric_dataframe import MetricStatisticsDataFrame from sledge.sledgeboard.base.data_class import SledgeBoardFile logger = logging.getLogger(__name__) def metr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/sledge", "path": "sledge/sledgeboard/utils/utils.py", "license": "apache-2.0", "size": 2634}
### File: projects/configs/sparsedrive_small_stage1.py # ================ base config =================== version = 'mini' version = 'trainval' length = {'trainval': 28130, 'mini': 323} plugin = True plugin_dir = "projects/mmdet3d_plugin/" dist_params = dict(backend="nccl") log_level = "INFO" work_dir = None total_ba...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/configs/sparsedrive_small_stage1.py", "license": "mit", "size": 22232}
### File: projects/configs/sparsedrive_small_stage2.py # ================ base config =================== version = 'mini' version = 'trainval' length = {'trainval': 28130, 'mini': 323} plugin = True plugin_dir = "projects/mmdet3d_plugin/" dist_params = dict(backend="nccl") log_level = "INFO" work_dir = None total_ba...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/configs/sparsedrive_small_stage2.py", "license": "mit", "size": 22334}
### File: projects/mmdet3d_plugin/__init__.py from .datasets import * from .models import * from .apis import * from .core.evaluation import *
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/__init__.py", "license": "mit", "size": 97}
### File: projects/mmdet3d_plugin/apis/__init__.py from .train import custom_train_model from .mmdet_train import custom_train_detector # from .test import custom_multi_gpu_test
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/apis/__init__.py", "license": "mit", "size": 128}
### File: projects/mmdet3d_plugin/apis/mmdet_train.py # --------------------------------------------- # Copyright (c) OpenMMLab. All rights reserved. # --------------------------------------------- # Modified by Zhiqi Li # --------------------------------------------- import random import warnings import numpy as np ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/apis/mmdet_train.py", "license": "mit", "size": 7038}
### File: projects/mmdet3d_plugin/apis/test.py # --------------------------------------------- # Copyright (c) OpenMMLab. All rights reserved. # --------------------------------------------- # Modified by Zhiqi Li # --------------------------------------------- import os.path as osp import pickle import shutil import ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/apis/test.py", "license": "mit", "size": 5960}
### File: projects/mmdet3d_plugin/apis/train.py # --------------------------------------------- # Copyright (c) OpenMMLab. All rights reserved. # --------------------------------------------- # Modified by Zhiqi Li # --------------------------------------------- from .mmdet_train import custom_train_detector # from m...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/apis/train.py", "license": "mit", "size": 1441}
### File: projects/mmdet3d_plugin/core/box3d.py X, Y, Z, W, L, H, SIN_YAW, COS_YAW, VX, VY, VZ = list(range(11)) # undecoded CNS, YNS = 0, 1 # centerness and yawness indices in quality YAW = 6 # decoded
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/core/box3d.py", "license": "mit", "size": 158}
### File: projects/mmdet3d_plugin/core/evaluation/__init__.py from .eval_hooks import CustomDistEvalHook
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/core/evaluation/__init__.py", "license": "mit", "size": 42}
### File: projects/mmdet3d_plugin/core/evaluation/eval_hooks.py # Note: Considering that MMCV's EvalHook updated its interface in V1.3.16, # in order to avoid strong version dependency, we did not directly # inherit EvalHook but BaseDistEvalHook. import bisect import os.path as osp import mmcv import torch.distribute...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/core/evaluation/eval_hooks.py", "license": "mit", "size": 3603}
### File: projects/mmdet3d_plugin/datasets/__init__.py from .nuscenes_3d_dataset import NuScenes3DDataset from .builder import * from .pipelines import * from .samplers import * __all__ = [ 'NuScenes3DDataset', "custom_build_dataset", ]
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/__init__.py", "license": "mit", "size": 191}
### File: projects/mmdet3d_plugin/datasets/builder.py import copy import platform import random from functools import partial import numpy as np from mmcv.parallel import collate from mmcv.runner import get_dist_info from mmcv.utils import Registry, build_from_cfg from torch.utils.data import DataLoader from mmdet.da...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/builder.py", "license": "mit", "size": 6126}
### File: projects/mmdet3d_plugin/datasets/evaluation/map/AP.py import numpy as np from .distance import chamfer_distance, frechet_distance, chamfer_distance_batch from typing import List, Tuple, Union from numpy.typing import NDArray def average_precision(recalls, precisions, mode='area'): """Calculate average pr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/evaluation/map/AP.py", "license": "mit", "size": 4574}
### File: projects/mmdet3d_plugin/datasets/evaluation/map/distance.py from scipy.spatial import distance from numpy.typing import NDArray import torch def chamfer_distance(line1: NDArray, line2: NDArray) -> float: ''' Calculate chamfer distance between two lines. Make sure the lines are interpolated. Arg...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/evaluation/map/distance.py", "license": "mit", "size": 2143}
### File: projects/mmdet3d_plugin/datasets/evaluation/map/vector_eval.py import prettytable from typing import Dict, List, Optional from time import time from copy import deepcopy from multiprocessing import Pool from logging import Logger from functools import partial, cached_property import numpy as np from numpy.ty...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/evaluation/map/vector_eval.py", "license": "mit", "size": 10645}
### File: projects/mmdet3d_plugin/datasets/evaluation/motion/motion_eval_uniad.py # nuScenes dev-kit. # Code written by Holger Caesar & Oscar Beijbom, 2018. import argparse import json import os import random import time import tqdm from typing import Tuple, Dict, Any import numpy as np from nuscenes import NuScenes...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/evaluation/motion/motion_eval_uniad.py", "license": "mit", "size": 11790}
### File: projects/mmdet3d_plugin/datasets/evaluation/motion/motion_utils.py # nuScenes dev-kit. # Code written by Holger Caesar & Oscar Beijbom, 2018. import argparse import json import os import random import time import tqdm from typing import Tuple, Dict, Any, Callable import numpy as np from nuscenes import NuS...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/evaluation/motion/motion_utils.py", "license": "mit", "size": 26684}
### File: projects/mmdet3d_plugin/datasets/evaluation/planning/planning_eval.py from tqdm import tqdm import torch import torch.nn as nn import numpy as np from shapely.geometry import Polygon from mmcv.utils import print_log from mmdet.datasets import build_dataset, build_dataloader from projects.mmdet3d_plugin.data...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/evaluation/planning/planning_eval.py", "license": "mit", "size": 6440}
### File: projects/mmdet3d_plugin/datasets/map_utils/nuscmap_extractor.py from shapely.geometry import LineString, box, Polygon from shapely import ops, strtree import numpy as np from nuscenes.map_expansion.map_api import NuScenesMap, NuScenesMapExplorer from nuscenes.eval.common.utils import quaternion_yaw from pyqu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/map_utils/nuscmap_extractor.py", "license": "mit", "size": 6118}
### File: projects/mmdet3d_plugin/datasets/map_utils/utils.py from shapely.geometry import LineString, box, Polygon, LinearRing from shapely.geometry.base import BaseGeometry from shapely import ops import numpy as np from scipy.spatial import distance from typing import List, Optional, Tuple from numpy.typing import N...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/map_utils/utils.py", "license": "mit", "size": 3967}
### File: projects/mmdet3d_plugin/datasets/nuscenes_3d_dataset.py import random import math import os from os import path as osp import cv2 import tempfile import copy import prettytable import numpy as np import torch from torch.utils.data import Dataset import pyquaternion from shapely.geometry import LineString fro...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/nuscenes_3d_dataset.py", "license": "mit", "size": 42137}
### File: projects/mmdet3d_plugin/datasets/pipelines/__init__.py from .transform import ( InstanceNameFilter, CircleObjectRangeFilter, NormalizeMultiviewImage, NuScenesSparse4DAdaptor, MultiScaleDepthMapGenerator, ) from .augment import ( ResizeCropFlipImage, BBoxRotation, PhotoMetricDis...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/pipelines/__init__.py", "license": "mit", "size": 725}
### File: projects/mmdet3d_plugin/datasets/pipelines/augment.py import torch import numpy as np from numpy import random import mmcv from mmdet.datasets.builder import PIPELINES from PIL import Image @PIPELINES.register_module() class ResizeCropFlipImage(object): def __call__(self, results): aug_config =...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/pipelines/augment.py", "license": "mit", "size": 8141}
### File: projects/mmdet3d_plugin/datasets/pipelines/loading.py import numpy as np import mmcv from mmdet.datasets.builder import PIPELINES @PIPELINES.register_module() class LoadMultiViewImageFromFiles(object): """Load multi channel images from a list of separate channel files. Expects results['img_filename...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/pipelines/loading.py", "license": "mit", "size": 6891}
### File: projects/mmdet3d_plugin/datasets/pipelines/transform.py import numpy as np import mmcv from mmcv.parallel import DataContainer as DC from mmdet.datasets.builder import PIPELINES from mmdet.datasets.pipelines import to_tensor @PIPELINES.register_module() class MultiScaleDepthMapGenerator(object): def __i...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/pipelines/transform.py", "license": "mit", "size": 8855}
### File: projects/mmdet3d_plugin/datasets/pipelines/vectorize.py from typing import List, Tuple, Union, Dict import numpy as np from shapely.geometry import LineString from numpy.typing import NDArray from mmcv.parallel import DataContainer as DC from mmdet.datasets.builder import PIPELINES @PIPELINES.register_mod...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/pipelines/vectorize.py", "license": "mit", "size": 7673}
### File: projects/mmdet3d_plugin/datasets/samplers/__init__.py from .group_sampler import DistributedGroupSampler from .distributed_sampler import DistributedSampler from .sampler import SAMPLER, build_sampler from .group_in_batch_sampler import ( GroupInBatchSampler, )
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/samplers/__init__.py", "license": "mit", "size": 212}
### File: projects/mmdet3d_plugin/datasets/samplers/distributed_sampler.py import math import torch from torch.utils.data import DistributedSampler as _DistributedSampler from .sampler import SAMPLER import pdb import sys class ForkedPdb(pdb.Pdb): def interaction(self, *args, **kwargs): _stdin = sys.std...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/samplers/distributed_sampler.py", "license": "mit", "size": 2567}
### File: projects/mmdet3d_plugin/datasets/samplers/group_in_batch_sampler.py # https://github.com/Divadi/SOLOFusion/blob/main/mmdet3d/datasets/samplers/infinite_group_each_sample_in_batch_sampler.py import itertools import copy import numpy as np import torch import torch.distributed as dist from mmcv.runner import g...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/samplers/group_in_batch_sampler.py", "license": "mit", "size": 6560}
### File: projects/mmdet3d_plugin/datasets/samplers/group_sampler.py # Copyright (c) OpenMMLab. All rights reserved. import math import numpy as np import torch from mmcv.runner import get_dist_info from torch.utils.data import Sampler from .sampler import SAMPLER import random from IPython import embed @SAMPLER.reg...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/samplers/group_sampler.py", "license": "mit", "size": 4133}
### File: projects/mmdet3d_plugin/datasets/samplers/sampler.py from mmcv.utils.registry import Registry, build_from_cfg SAMPLER = Registry("sampler") def build_sampler(cfg, default_args): return build_from_cfg(cfg, SAMPLER, default_args)
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/samplers/sampler.py", "license": "mit", "size": 182}
### File: projects/mmdet3d_plugin/datasets/utils.py import copy import cv2 import numpy as np import torch from projects.mmdet3d_plugin.core.box3d import * def box3d_to_corners(box3d): if isinstance(box3d, torch.Tensor): box3d = box3d.detach().cpu().numpy() corners_norm = np.stack(np.unravel_index(n...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/datasets/utils.py", "license": "mit", "size": 7576}
### File: projects/mmdet3d_plugin/models/__init__.py from .sparsedrive import SparseDrive from .sparsedrive_head import SparseDriveHead from .blocks import ( DeformableFeatureAggregation, DenseDepthNet, AsymmetricFFN, ) from .instance_bank import InstanceBank from .detection3d import ( SparseBox3DDecode...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/__init__.py", "license": "mit", "size": 733}
### File: projects/mmdet3d_plugin/models/attention.py import warnings import math import torch import torch.nn as nn from torch.nn.functional import linear from torch.nn.init import xavier_uniform_, constant_ from mmcv.utils import deprecated_api_warning from mmcv.runner import auto_fp16 from mmcv.runner.base_module ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/attention.py", "license": "mit", "size": 13164}
### File: projects/mmdet3d_plugin/models/base_target.py from abc import ABC, abstractmethod __all__ = ["BaseTargetWithDenoising"] class BaseTargetWithDenoising(ABC): def __init__(self, num_dn_groups=0, num_temp_dn_groups=0): super(BaseTargetWithDenoising, self).__init__() self.num_dn_groups = nu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/base_target.py", "license": "mit", "size": 1543}
### File: projects/mmdet3d_plugin/models/blocks.py from typing import List, Optional, Tuple import numpy as np import torch import torch.nn as nn from torch.cuda.amp.autocast_mode import autocast from mmcv.cnn import Linear, build_activation_layer, build_norm_layer from mmcv.runner.base_module import Sequential, Base...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/blocks.py", "license": "mit", "size": 13329}
### File: projects/mmdet3d_plugin/models/detection3d/__init__.py from .decoder import SparseBox3DDecoder from .target import SparseBox3DTarget from .detection3d_blocks import ( SparseBox3DRefinementModule, SparseBox3DKeyPointsGenerator, SparseBox3DEncoder, ) from .losses import SparseBox3DLoss from .detecti...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/detection3d/__init__.py", "license": "mit", "size": 285}
### File: projects/mmdet3d_plugin/models/detection3d/decoder.py from typing import Optional import torch from mmdet.core.bbox.builder import BBOX_CODERS from projects.mmdet3d_plugin.core.box3d import * def decode_box(box): yaw = torch.atan2(box[..., SIN_YAW], box[..., COS_YAW]) box = torch.cat( [ ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/detection3d/decoder.py", "license": "mit", "size": 3472}
### File: projects/mmdet3d_plugin/models/detection3d/detection3d_blocks.py import torch import torch.nn as nn import numpy as np from mmcv.cnn import Linear, Scale, bias_init_with_prob from mmcv.runner.base_module import Sequential, BaseModule from mmcv.cnn import xavier_init from mmcv.cnn.bricks.registry import ( ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/detection3d/detection3d_blocks.py", "license": "mit", "size": 10352}
### File: projects/mmdet3d_plugin/models/detection3d/detection3d_head.py from typing import List, Optional, Tuple, Union import warnings import numpy as np import torch import torch.nn as nn from mmcv.cnn.bricks.registry import ( ATTENTION, PLUGIN_LAYERS, POSITIONAL_ENCODING, FEEDFORWARD_NETWORK, ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/detection3d/detection3d_head.py", "license": "mit", "size": 20109}
### File: projects/mmdet3d_plugin/models/detection3d/losses.py import torch import torch.nn as nn from mmcv.utils import build_from_cfg from mmdet.models.builder import LOSSES from projects.mmdet3d_plugin.core.box3d import * @LOSSES.register_module() class SparseBox3DLoss(nn.Module): def __init__( self,...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/detection3d/losses.py", "license": "mit", "size": 2952}
### File: projects/mmdet3d_plugin/models/detection3d/target.py import torch import numpy as np import torch.nn.functional as F from scipy.optimize import linear_sum_assignment from mmdet.core.bbox.builder import BBOX_SAMPLERS from projects.mmdet3d_plugin.core.box3d import * from ..base_target import BaseTargetWithDen...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/detection3d/target.py", "license": "mit", "size": 16024}
### File: projects/mmdet3d_plugin/models/grid_mask.py import torch import torch.nn as nn import numpy as np from PIL import Image class Grid(object): def __init__( self, use_h, use_w, rotate=1, offset=False, ratio=0.5, mode=0, prob=1.0 ): self.use_h = use_h self.use_w = use_w s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/grid_mask.py", "license": "mit", "size": 4090}
### File: projects/mmdet3d_plugin/models/instance_bank.py import torch from torch import nn import torch.nn.functional as F import numpy as np from mmcv.utils import build_from_cfg from mmcv.cnn.bricks.registry import PLUGIN_LAYERS __all__ = ["InstanceBank"] def topk(confidence, k, *inputs): bs, N = confidence....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/instance_bank.py", "license": "mit", "size": 9310}
### File: projects/mmdet3d_plugin/models/map/__init__.py from .decoder import SparsePoint3DDecoder from .target import SparsePoint3DTarget, HungarianLinesAssigner from .match_cost import LinesL1Cost, MapQueriesCost from .loss import LinesL1Loss, SparseLineLoss from .map_blocks import ( SparsePoint3DRefinementModule...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/map/__init__.py", "license": "mit", "size": 329}
### File: projects/mmdet3d_plugin/models/map/decoder.py from typing import Optional, List import torch from mmdet.core.bbox.builder import BBOX_CODERS @BBOX_CODERS.register_module() class SparsePoint3DDecoder(object): def __init__( self, coords_dim: int = 2, score_threshold: Optional[flo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/map/decoder.py", "license": "mit", "size": 1641}
### File: projects/mmdet3d_plugin/models/map/loss.py import torch import torch.nn as nn from mmcv.utils import build_from_cfg from mmdet.models.builder import LOSSES from mmdet.models.losses import l1_loss, smooth_l1_loss @LOSSES.register_module() class LinesL1Loss(nn.Module): def __init__(self, reduction='mean...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/map/loss.py", "license": "mit", "size": 3646}
### File: projects/mmdet3d_plugin/models/map/map_blocks.py from typing import Optional, List, Tuple import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from mmcv.cnn import Linear, Scale, bias_init_with_prob from mmcv.runner.base_module import Sequential, BaseModule from mmcv.cnn imp...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/map/map_blocks.py", "license": "mit", "size": 6594}
### File: projects/mmdet3d_plugin/models/map/match_cost.py import torch from mmdet.core.bbox.match_costs.builder import MATCH_COST from mmdet.core.bbox.match_costs import build_match_cost from torch.nn.functional import smooth_l1_loss @MATCH_COST.register_module() class LinesL1Cost(object): """LinesL1Cost. A...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/SparseDrive", "path": "projects/mmdet3d_plugin/models/map/match_cost.py", "license": "mit", "size": 3420}