An interactive data labeling tool built with Flask and Plotly following a modern web app architecture. It supports dynamic column detection, multi-dataset management, region selection labeling, time series and event labeling, and visualization/analysis of multiple data types.
- 🏗️ Modern architecture – Flask application factory pattern, clean structure, easy to extend.
- 🚀 Auto initialization – Generates example datasets on first run for an out-of-the-box experience.
- 🔍 Dynamic column detection – Automatically detects CSV columns and generates visualization configs.
- 📁 Flexible path management – Configure multiple dataset roots (absolute/relative) in
config.py. - 🎨 Automatic color assignment – Smart, distinct colors for each data column and label.
- 🎯 Interactive labeling – Region selection and label management; supports index-based and time-based modes.
- 📊 Multi-dimensional visualization – Display trends of multiple columns for easy comparison.
- ⏰ Time series support – Auto-detect time columns and enable calendar-time visualization and labeling.
- 📈 Stock data support – Built-in visualization for OHLCV-formatted financial data.
- ⚖️ Smart data processing – Auto-normalization for
Volumeto improve readability. - 🏷️ Rich label system – Labels stored as JSON with support for complex metadata.
The project uses a modular structure, separating core logic from routes for maintainability.
ts_label/
├── app/ # Flask app core
│ ├── routes/ # Blueprints
│ │ ├── main.py # - main page routes
│ │ └── api.py # - API routes
│ ├── services.py # Business services (e.g., LabelManager)
│ └── __init__.py # Application factory create_app()
├── dataset/ # Dataset root (configurable)
│ ├── train/
│ ├── test/
│ ├── val/
│ └── demo/
├── static/ # Static assets (CSS, JS)
├── templates/ # HTML templates
├── config.py # Configuration (e.g., dataset paths)
├── data.py # Data processing and generation
├── run.py # App entrypoint
├── requirements.txt # Python dependencies
└── README.md # Project readme
pip install -r requirements.txtpython run.pyOn startup, if the dataset directory is empty, example data will be generated automatically.
- Local: http://localhost:5000
- Network: http://[your-ip-address]:5000
(Feature set mirrors earlier versions but is implemented on a more robust backend.)
- Auto detection of all columns in CSV files.
- Smart formatting of column display names (e.g.,
wind_speed_1→Wind Speed 1). - Color palette assignment: up to 10 distinct colors per plot group.
- Automatic time detection – recognizes common time column names (
date,time,timestamp, etc.). - Time-axis visualization – sets x-axis type appropriately.
- Time-based labeling – supports labels based on calendar time ranges.
- OHLCV format – visualize open, high, low, close, and volume.
- Technical indicators – auto-computes MA5, MA20 moving averages.
- Volume normalization – automatically normalizes the Volume column.
Automatically assigns distinct colors to data columns and labels to improve visual separability.
- Supports configurations for
train,test,val, anddemodatasets. - Quick switching across dataset types.
- Real-time display of dataset statistics.
- Manage multiple dataset files.
- Generate sample datasets (wind speed, stock, multi-sensor data).
- Auto-associate data files with corresponding label files.
- One-click creation of all sample datasets.
- 🖱️ Drag to select data regions.
- 🎨 Real-time highlight of selected regions.
- 🏷️ Custom label names.
- 📝 Add/Delete/Edit labels (via files).
- 🔄 Label type compatibility – supports both index-based and calendar-time labels.
- 📱 Responsive design with mobile support.
- 🔧 Toolbar mode switch (select/pan) with shortcuts (
s/p). - 📋 Dataset info panel.
- 📊 Real-time status showing current selection range and point count.
The system can process CSV files with arbitrary column names. The first column is typically a sequence index or timestamp.
seq,wind_speed_1,wind_speed_2,temperature_1
0,10.5,8.2,22.1
1,11.2,9.1,21.8
...Standard OHLCV format with Open, High, Low, Close, Volume.
Date,Open,High,Low,Close,Volume,MA5,MA20,Return_Pct
2020-01-01,100.00,105.20,98.50,103.45,1234567,103.45,103.45,0.00
2020-01-02,103.50,106.80,102.10,105.20,987654,104.32,104.32,1.69
...Labels are stored as JSON in the labels directory, paired with each data file. See Label format details for the full schema.
- Backend: Python, Flask
- Data processing: pandas, numpy
- Visualization: Plotly.js
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Architecture: Flask Blueprints, Application Factory
Issues and pull requests are welcome!
- Project improvement ideas – suggestions for improving the project.
- Label data format – detailed explanation of the label schema.
- Changelog – version history.
- App logs – runtime logs.
No License
