src.dataset.gc_dataset module#
- class src.dataset.gc_dataset.GCDataset(*args: Any, **kwargs: Any)[source]#
Bases:
BaseDatasetGrand Central Station (GC) dataset loader.
This is a high-density crowd dataset.
- raw_fps = 25#
- classmethod load_data(args: Namespace, data_path: str) GCDataset[source]#
Load the GC dataset.
Read all txt files in the directory, apply the homography transform, and remove trajectory points with abnormal speeds. Load and transpose the map image so the coordinate system aligns correctly.
- Parameters:
args (Namespace) – Global arguments.
data_path (str) – Dataset directory path.
- Returns:
Initialized dataset instance.
- Return type:
- classmethod get_homography_mat() numpy.ndarray[source]#
Get the fixed homography matrix for the GC dataset.
- Returns:
3x3 homography matrix.
- Return type:
np.ndarray
- classmethod get_abnormal(df: pandas.DataFrame, min_abnormal_speed=5.0, min_abnormal_whis=3.0) pandas.Series[source]#
Detect and mark abnormal trajectory points, such as points with excessively high speeds.
Uses an IQR-based outlier detection algorithm.
- Parameters:
df (pd.DataFrame) – DataFrame containing trajectory data.
min_abnormal_speed (float) – Minimum abnormal-speed threshold.
min_abnormal_whis (float) – IQR multiplier.
- Returns:
Boolean series where True means the row is normal and False means it is abnormal and should be removed.
- Return type:
pd.Series