ginnyxxxxxxx commited on
Commit
0450206
·
1 Parent(s): 543266c
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -835,14 +835,16 @@ def build_demo_text(row):
835
 
836
 
837
  def build_raw_staypoints(agent_sp, n=12):
838
- cols = ["start_datetime", "end_datetime", "duration_min", "name", "act_label"]
839
  df = agent_sp[cols].head(n).copy()
840
  df["start_datetime"] = df["start_datetime"].dt.strftime("%m/%d %H:%M")
841
  df["end_datetime"] = df["end_datetime"].dt.strftime("%H:%M")
842
  df["duration_min"] = df["duration_min"].astype(int).astype(str) + " min"
843
- df.columns = ["Start", "End", "Duration", "Venue", "Activity"]
 
 
844
  lines = ["Stay Points (raw input — first {} records)".format(n), ""]
845
- col_w = {"Start": 11, "End": 7, "Duration": 9, "Venue": 28, "Activity": 18}
846
  header = " ".join(k.ljust(v) for k, v in col_w.items())
847
  lines.append(header)
848
  lines.append("-" * len(header))
@@ -947,8 +949,8 @@ with gr.Blocks(title="HiCoTraj Demo") as app:
947
  gr.Markdown("## HiCoTraj — Trajectory Visualization & Hierarchical CoT Demo")
948
  gr.Markdown("*Zero-Shot Demographic Reasoning via Hierarchical Chain-of-Thought Prompting from Trajectory* · ACM SIGSPATIAL GeoGenAgent 2025")
949
  gr.Markdown("""
950
- **Dataset:** NUMOSIM — a synthetic mobility dataset with realistic activity patterns across 6,000 agents.
951
- > Stanford C, Adari S, Liao X, et al. *NUMoSim: A Synthetic Mobility Dataset with Anomaly Detection Benchmarks.* ACM SIGSPATIAL Workshop on Geospatial Anomaly Detection, 2024.
952
  """)
953
 
954
  gr.Markdown("### Select Agent")
@@ -1023,4 +1025,4 @@ with gr.Blocks(title="HiCoTraj Demo") as app:
1023
  outputs=[raw_out, show_all_btn]
1024
  )
1025
 
1026
- app.launch(show_error=True, theme=gr.themes.Soft())
 
835
 
836
 
837
  def build_raw_staypoints(agent_sp, n=12):
838
+ cols = ["start_datetime", "end_datetime", "duration_min", "latitude", "longitude", "name", "act_label"]
839
  df = agent_sp[cols].head(n).copy()
840
  df["start_datetime"] = df["start_datetime"].dt.strftime("%m/%d %H:%M")
841
  df["end_datetime"] = df["end_datetime"].dt.strftime("%H:%M")
842
  df["duration_min"] = df["duration_min"].astype(int).astype(str) + " min"
843
+ df["latitude"] = df["latitude"].round(5).astype(str)
844
+ df["longitude"] = df["longitude"].round(5).astype(str)
845
+ df.columns = ["Start", "End", "Duration", "Lat", "Lon", "Venue", "Activity"]
846
  lines = ["Stay Points (raw input — first {} records)".format(n), ""]
847
+ col_w = {"Start": 11, "End": 7, "Duration": 9, "Lat": 9, "Lon": 10, "Venue": 26, "Activity": 16}
848
  header = " ".join(k.ljust(v) for k, v in col_w.items())
849
  lines.append(header)
850
  lines.append("-" * len(header))
 
949
  gr.Markdown("## HiCoTraj — Trajectory Visualization & Hierarchical CoT Demo")
950
  gr.Markdown("*Zero-Shot Demographic Reasoning via Hierarchical Chain-of-Thought Prompting from Trajectory* · ACM SIGSPATIAL GeoGenAgent 2025")
951
  gr.Markdown("""
952
+ **Dataset:** NUMOSIM[1]
953
+ > [1]Stanford C, Adari S, Liao X, et al. *NUMoSim: A Synthetic Mobility Dataset with Anomaly Detection Benchmarks.* ACM SIGSPATIAL Workshop on Geospatial Anomaly Detection, 2024.
954
  """)
955
 
956
  gr.Markdown("### Select Agent")
 
1025
  outputs=[raw_out, show_all_btn]
1026
  )
1027
 
1028
+ app.launch(show_error=True, theme=gr.themes.Soft(), share=True)