Skip to content

jlliRUC/STORM

Repository files navigation

This repository contains the code used in paper

Requirements

  • Ubuntu OS
  • Python 3.9.13 (tested)
  • pip install -r requirements.txt
  • Download arbitrary dataset (e.g., Porto) to "./data/{dataset_name}/{dataset_name}.pkl", convert it to a DataFrame containing columns ["Traj_ID", "Timestamps", "Locations", "Length"].
  • Download the osm file (e.g., "portugal-latest.osm.pbf") to "./data/{dataset_name}/meta/"

Map-matching

  1. Get the .osm file of the city
    python map-matching/osm_convert.py
  2. Get the road network files for the city (such as "porto_nodes.csv")
    python map-matching/osm2roadnetwork.py
  3. Get the map-matched results for trajectories in "porto.pkl".
    python map-matching/HMMM.py
    Note that even with multiprocessing, it will take a long time.

Preprocessing

  1. Data augmentation for pre-training
    python preprocess/augmentation.py
  2. Extract road segments features
    python preprocess/rs_extract.py
  3. Extract trajectory features.
    python preprocess/feature_extract.py

Pre-training

  1. Pre-training on a large dataset, which might take a long time.
    python pretrain.py

Fine-tuning

  1. Generate the fine-tuning dataset
    python dataset_preparation.py
  2. Fine-tune the pre-trained encoder
    python finetune_SL.py
    If you want to train from scratch, set "self.load_pretrain" of Config() in config.py to False.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages