flashstudio 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {flashstudio-0.1.2 → flashstudio-0.1.3}/PKG-INFO +164 -20
  2. flashstudio-0.1.3/README.md +267 -0
  3. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio/__init__.py +1 -1
  4. flashstudio-0.1.3/flashstudio/app.py +123 -0
  5. flashstudio-0.1.3/flashstudio/components/project_manager.py +480 -0
  6. flashstudio-0.1.3/flashstudio/components/sidebar.py +86 -0
  7. flashstudio-0.1.3/flashstudio/components/styles.py +304 -0
  8. flashstudio-0.1.3/flashstudio/components/wizard.py +45 -0
  9. flashstudio-0.1.3/flashstudio/components/zone_drawer/__init__.py +177 -0
  10. flashstudio-0.1.3/flashstudio/constants.py +211 -0
  11. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio/launcher.py +33 -7
  12. flashstudio-0.1.3/flashstudio/pages/dashboard.py +251 -0
  13. flashstudio-0.1.3/flashstudio/pages/data.py +865 -0
  14. flashstudio-0.1.3/flashstudio/pages/export.py +160 -0
  15. flashstudio-0.1.3/flashstudio/pages/inference.py +850 -0
  16. flashstudio-0.1.3/flashstudio/pages/model.py +281 -0
  17. flashstudio-0.1.3/flashstudio/pages/training.py +2079 -0
  18. flashstudio-0.1.3/flashstudio/utils/__init__.py +114 -0
  19. flashstudio-0.1.3/flashstudio/utils/config.py +97 -0
  20. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio/utils/device.py +12 -3
  21. flashstudio-0.1.3/flashstudio/utils/filesystem.py +67 -0
  22. flashstudio-0.1.3/flashstudio/utils/jobs.py +95 -0
  23. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio.egg-info/PKG-INFO +164 -20
  24. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio.egg-info/SOURCES.txt +7 -1
  25. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio.egg-info/requires.txt +4 -0
  26. flashstudio-0.1.3/flashstudio.egg-info/top_level.txt +2 -0
  27. {flashstudio-0.1.2 → flashstudio-0.1.3}/pyproject.toml +5 -1
  28. flashstudio-0.1.2/README.md +0 -127
  29. flashstudio-0.1.2/flashstudio/app.py +0 -64
  30. flashstudio-0.1.2/flashstudio/components/sidebar.py +0 -45
  31. flashstudio-0.1.2/flashstudio/components/styles.py +0 -273
  32. flashstudio-0.1.2/flashstudio/components/wizard.py +0 -46
  33. flashstudio-0.1.2/flashstudio/pages/dashboard.py +0 -168
  34. flashstudio-0.1.2/flashstudio/pages/data.py +0 -272
  35. flashstudio-0.1.2/flashstudio/pages/export.py +0 -212
  36. flashstudio-0.1.2/flashstudio/pages/inference.py +0 -1112
  37. flashstudio-0.1.2/flashstudio/pages/model.py +0 -370
  38. flashstudio-0.1.2/flashstudio/pages/training.py +0 -672
  39. flashstudio-0.1.2/flashstudio/utils/__init__.py +0 -0
  40. flashstudio-0.1.2/flashstudio.egg-info/top_level.txt +0 -1
  41. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio/cli.py +0 -0
  42. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio/components/__init__.py +0 -0
  43. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio/pages/__init__.py +0 -0
  44. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio.egg-info/dependency_links.txt +0 -0
  45. {flashstudio-0.1.2 → flashstudio-0.1.3}/flashstudio.egg-info/entry_points.txt +0 -0
  46. {flashstudio-0.1.2 → flashstudio-0.1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flashstudio
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Interactive Training & Inference UI for FlashDet — runs on Google Colab
5
5
  Author: Gaurav14cs17
6
6
  License: Apache-2.0
@@ -20,23 +20,37 @@ Requires-Dist: pandas>=1.5
20
20
  Requires-Dist: pillow>=9.0
21
21
  Requires-Dist: numpy>=1.21
22
22
  Requires-Dist: pyngrok>=6.0
23
+ Requires-Dist: opencv-python>=4.5
24
+ Requires-Dist: pyyaml>=6.0
25
+ Requires-Dist: flashdet
23
26
  Provides-Extra: full
24
27
  Requires-Dist: pyngrok>=6.0; extra == "full"
25
28
  Requires-Dist: torch>=2.0; extra == "full"
26
29
  Requires-Dist: opencv-python>=4.5; extra == "full"
30
+ Requires-Dist: flashdet[export]; extra == "full"
27
31
  Provides-Extra: colab
28
32
  Requires-Dist: pyngrok>=6.0; extra == "colab"
29
33
  Provides-Extra: dev
30
34
  Requires-Dist: ruff; extra == "dev"
31
35
  Requires-Dist: pytest; extra == "dev"
32
36
 
33
- # ⚡ FlashStudio
37
+ <p align="center">
38
+ <img src="https://raw.githubusercontent.com/FlashVision/FlashStudio/main/assets/logo.png" width="200" alt="FlashStudio Logo">
39
+ </p>
34
40
 
35
- [![PyPI version](https://badge.fury.io/py/flashstudio.svg)](https://pypi.org/project/flashstudio/)
36
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
37
- [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
41
+ <h1 align="center">FlashStudio</h1>
38
42
 
39
- **Interactive Training & Inference UI for FlashDet** — runs locally or on Google Colab with a Streamlit interface.
43
+ <p align="center">
44
+ <a href="https://pypi.org/project/flashstudio/"><img src="https://badge.fury.io/py/flashstudio.svg" alt="PyPI version"></a>
45
+ <img src="https://img.shields.io/badge/python-3.9+-blue.svg?logo=python&logoColor=white" alt="Python 3.9+">
46
+ <img src="https://img.shields.io/badge/Streamlit-UI-FF4B4B?logo=streamlit&logoColor=white" alt="Streamlit">
47
+ <img src="https://img.shields.io/badge/FlashDet-Powered-00CCFF?logo=lightning&logoColor=white" alt="FlashDet">
48
+ <img src="https://img.shields.io/badge/License-Apache%202.0-green.svg" alt="License">
49
+ </p>
50
+
51
+ <p align="center">
52
+ <b>Interactive Training & Inference UI for FlashDet — runs locally or on Google Colab with a Streamlit interface.</b>
53
+ </p>
40
54
 
41
55
  <p align="center">
42
56
  <img src="docs/mockups/flashstudio_streamlit_mockup.png" width="800" alt="FlashStudio UI"/>
@@ -52,25 +66,69 @@ Requires-Dist: pytest; extra == "dev"
52
66
  - 📊 **Dashboard** — Overview with recent training runs from workspace
53
67
  - 🚀 **Colab Support** — ngrok tunneling for remote access
54
68
 
55
- ## Install
69
+ ---
56
70
 
57
- ```bash
58
- pip install flashstudio
59
- ```
71
+ ## UI Tour
72
+
73
+ ### Dashboard
74
+ Project overview with key metrics (GPU, Dataset, Model, mAP), pipeline status, quick actions, and recent training runs.
60
75
 
61
- ### Install with all dependencies (PyTorch + OpenCV + ngrok)
76
+ <p align="center">
77
+ <img src="demos/01_dashboard.gif" width="800" alt="Dashboard"/>
78
+ </p>
79
+
80
+ ### Data Management
81
+ Upload datasets (ZIP/TAR), download from `flashdet` registry, preview images with navigation, and verify annotations.
82
+
83
+ <p align="center">
84
+ <img src="demos/02_data.gif" width="800" alt="Data Management"/>
85
+ </p>
86
+
87
+ ### Model Configuration
88
+ Choose from 6 FlashDet sizes + YOLO variants. Configure hyperparameters, augmentations, and advanced settings (memory optimization, distributed training).
89
+
90
+ <p align="center">
91
+ <img src="demos/03_model.gif" width="800" alt="Model Configuration"/>
92
+ </p>
93
+
94
+ ### Training
95
+ Create experiments, launch training with preflight checks, and monitor runs with real-time curves, visualizations, ground truth, logs, and file browser.
96
+
97
+ <p align="center">
98
+ <img src="demos/04_training.gif" width="800" alt="Training"/>
99
+ </p>
100
+
101
+ ### Export
102
+ Export trained models to ONNX format with configurable opset, image size, and dynamic batching. Auto-detects saved weights from training.
103
+
104
+ <p align="center">
105
+ <img src="demos/05_export.gif" width="800" alt="Export"/>
106
+ </p>
107
+
108
+ ### Inference
109
+ Full inference pipeline with 17 built-in solutions (object counting, speed estimation, heatmaps, security alarms, etc.). Interactive zone drawing with Polygon, Rectangle, and Line tools.
110
+
111
+ <p align="center">
112
+ <img src="demos/06_inference.gif" width="800" alt="Inference"/>
113
+ </p>
114
+
115
+ ---
116
+
117
+ ## Installation
118
+
119
+ ### Step 1: Install FlashStudio
62
120
 
63
121
  ```bash
64
- pip install flashstudio[full]
122
+ pip install flashstudio
65
123
  ```
66
124
 
67
- ### Install FlashDet (required for training/inference)
125
+ ### Step 2: Install FlashDet (required for training/inference)
68
126
 
69
127
  ```bash
70
128
  pip install git+https://github.com/FlashVision/FlashDet.git
71
129
  ```
72
130
 
73
- ### Development install
131
+ ### Development install (from source)
74
132
 
75
133
  ```bash
76
134
  git clone https://github.com/FlashVision/FlashStudio.git
@@ -78,34 +136,88 @@ cd FlashStudio
78
136
  pip install -e .
79
137
  ```
80
138
 
81
- ## Quick Start
139
+ ---
140
+
141
+ ## Usage — Local Machine
82
142
 
83
- ### CLI
143
+ ### Option 1: CLI
84
144
 
85
145
  ```bash
86
146
  flashstudio --port 8501
87
147
  ```
88
148
 
89
- ### Python (Streamlit directly)
149
+ ### Option 2: Streamlit directly
90
150
 
91
151
  ```bash
152
+ cd FlashStudio
92
153
  streamlit run flashstudio/app.py
93
154
  ```
94
155
 
95
- ### Python API (Google Colab)
156
+ Then open **http://localhost:8501** in your browser.
157
+
158
+ ---
159
+
160
+ ## Usage — Google Colab
161
+
162
+ ### Step 1: Install packages
163
+
164
+ ```python
165
+ !pip install flashstudio
166
+ !pip install git+https://github.com/FlashVision/FlashDet.git
167
+ ```
168
+
169
+ ### Step 2: Get ngrok token (free, one-time setup)
170
+
171
+ FlashStudio uses [ngrok](https://ngrok.com) to create a public URL for the Streamlit UI in Colab.
172
+
173
+ 1. **Sign up** (free): https://dashboard.ngrok.com/signup
174
+ 2. **Get your auth token**: https://dashboard.ngrok.com/get-started/your-authtoken
175
+ 3. Copy the token (looks like `2xAbC1234_something...`)
176
+
177
+ ### Step 3: Launch
178
+
179
+ ```python
180
+ from flashstudio import launch
181
+
182
+ # Pass your ngrok token
183
+ launch(ngrok_token="YOUR_NGROK_TOKEN_HERE")
184
+ ```
185
+
186
+ Or set it as an environment variable:
96
187
 
97
188
  ```python
189
+ import os
190
+ os.environ["NGROK_TOKEN"] = "YOUR_NGROK_TOKEN_HERE"
191
+
98
192
  from flashstudio import launch
99
- launch() # Opens ngrok tunnel in Colab, localhost otherwise
193
+ launch()
194
+ ```
195
+
196
+ ### Step 4: Open the URL
197
+
198
+ After launching, you'll see output like:
199
+
200
+ ```
201
+ ============================================================
202
+ FlashStudio is running!
203
+ Local: http://localhost:8501
204
+ Public: https://abc123.ngrok-free.app
205
+ ============================================================
100
206
  ```
101
207
 
102
- ## Google Colab
208
+ Click the **Public URL** to open FlashStudio in a new tab.
209
+
210
+ ---
211
+
212
+ ## Google Colab Notebooks (Ready to Use)
103
213
 
104
214
  | Notebook | Description | Link |
105
215
  |----------|-------------|------|
106
216
  | Training | Train FlashDet models | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FlashVision/FlashStudio/blob/main/notebooks/FlashStudio_Train.ipynb) |
107
217
  | Inference | Run detection on images/video | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FlashVision/FlashStudio/blob/main/notebooks/FlashStudio_Inference.ipynb) |
108
218
 
219
+ ---
220
+
109
221
  ## Supported Models
110
222
 
111
223
  | Model | Params | Best For |
@@ -118,6 +230,8 @@ launch() # Opens ngrok tunnel in Colab, localhost otherwise
118
230
  | FlashDet-X | ~9.0M | Max accuracy / Server |
119
231
  | YOLOv8/v9/v10/v11/YOLOX | Varies | General YOLO |
120
232
 
233
+ ---
234
+
121
235
  ## Architecture
122
236
 
123
237
  ```
@@ -148,10 +262,40 @@ FlashStudio/
148
262
  └── README.md
149
263
  ```
150
264
 
265
+ ---
266
+
267
+ ## Troubleshooting
268
+
269
+ ### `ModuleNotFoundError: No module named 'pyngrok'`
270
+
271
+ ```bash
272
+ pip install --upgrade flashstudio
273
+ ```
274
+
275
+ ### ngrok authentication error (`ERR_NGROK_4018`)
276
+
277
+ You need an ngrok auth token. Get one free at:
278
+ https://dashboard.ngrok.com/get-started/your-authtoken
279
+
280
+ Then pass it to `launch(ngrok_token="your_token")`.
281
+
282
+ ### Streamlit port already in use
283
+
284
+ ```bash
285
+ # Kill existing Streamlit processes
286
+ pkill -f "streamlit run"
287
+
288
+ # Then restart
289
+ flashstudio --port 8501
290
+ ```
291
+
292
+ ---
293
+
151
294
  ## Requirements
152
295
 
153
296
  - Python >= 3.9
154
297
  - FlashDet (`pip install git+https://github.com/FlashVision/FlashDet.git`)
298
+ - ngrok account (free) for Google Colab usage
155
299
  - GPU recommended for training (T4 or better)
156
300
 
157
301
  ## License
@@ -0,0 +1,267 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/FlashVision/FlashStudio/main/assets/logo.png" width="200" alt="FlashStudio Logo">
3
+ </p>
4
+
5
+ <h1 align="center">FlashStudio</h1>
6
+
7
+ <p align="center">
8
+ <a href="https://pypi.org/project/flashstudio/"><img src="https://badge.fury.io/py/flashstudio.svg" alt="PyPI version"></a>
9
+ <img src="https://img.shields.io/badge/python-3.9+-blue.svg?logo=python&logoColor=white" alt="Python 3.9+">
10
+ <img src="https://img.shields.io/badge/Streamlit-UI-FF4B4B?logo=streamlit&logoColor=white" alt="Streamlit">
11
+ <img src="https://img.shields.io/badge/FlashDet-Powered-00CCFF?logo=lightning&logoColor=white" alt="FlashDet">
12
+ <img src="https://img.shields.io/badge/License-Apache%202.0-green.svg" alt="License">
13
+ </p>
14
+
15
+ <p align="center">
16
+ <b>Interactive Training & Inference UI for FlashDet — runs locally or on Google Colab with a Streamlit interface.</b>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <img src="docs/mockups/flashstudio_streamlit_mockup.png" width="800" alt="FlashStudio UI"/>
21
+ </p>
22
+
23
+ ## Features
24
+
25
+ - 🏋️ **Training Dashboard** — Real-time monitoring with live loss curves, per-epoch visualizations, GT verification
26
+ - 🧠 **Model Config** — All 6 FlashDet sizes + YOLOv8/v9/v10/v11/YOLOX with accurate params
27
+ - 🔍 **Inference Pipeline** — 4-step wizard: Model → Data → Zone → Run (17 solutions, 6 trackers)
28
+ - 📤 **Export** — ONNX export with FP16 auto-generated weights
29
+ - 📦 **Data** — Native `flashdet download` datasets + custom upload (COCO/VOC/YOLO formats)
30
+ - 📊 **Dashboard** — Overview with recent training runs from workspace
31
+ - 🚀 **Colab Support** — ngrok tunneling for remote access
32
+
33
+ ---
34
+
35
+ ## UI Tour
36
+
37
+ ### Dashboard
38
+ Project overview with key metrics (GPU, Dataset, Model, mAP), pipeline status, quick actions, and recent training runs.
39
+
40
+ <p align="center">
41
+ <img src="demos/01_dashboard.gif" width="800" alt="Dashboard"/>
42
+ </p>
43
+
44
+ ### Data Management
45
+ Upload datasets (ZIP/TAR), download from `flashdet` registry, preview images with navigation, and verify annotations.
46
+
47
+ <p align="center">
48
+ <img src="demos/02_data.gif" width="800" alt="Data Management"/>
49
+ </p>
50
+
51
+ ### Model Configuration
52
+ Choose from 6 FlashDet sizes + YOLO variants. Configure hyperparameters, augmentations, and advanced settings (memory optimization, distributed training).
53
+
54
+ <p align="center">
55
+ <img src="demos/03_model.gif" width="800" alt="Model Configuration"/>
56
+ </p>
57
+
58
+ ### Training
59
+ Create experiments, launch training with preflight checks, and monitor runs with real-time curves, visualizations, ground truth, logs, and file browser.
60
+
61
+ <p align="center">
62
+ <img src="demos/04_training.gif" width="800" alt="Training"/>
63
+ </p>
64
+
65
+ ### Export
66
+ Export trained models to ONNX format with configurable opset, image size, and dynamic batching. Auto-detects saved weights from training.
67
+
68
+ <p align="center">
69
+ <img src="demos/05_export.gif" width="800" alt="Export"/>
70
+ </p>
71
+
72
+ ### Inference
73
+ Full inference pipeline with 17 built-in solutions (object counting, speed estimation, heatmaps, security alarms, etc.). Interactive zone drawing with Polygon, Rectangle, and Line tools.
74
+
75
+ <p align="center">
76
+ <img src="demos/06_inference.gif" width="800" alt="Inference"/>
77
+ </p>
78
+
79
+ ---
80
+
81
+ ## Installation
82
+
83
+ ### Step 1: Install FlashStudio
84
+
85
+ ```bash
86
+ pip install flashstudio
87
+ ```
88
+
89
+ ### Step 2: Install FlashDet (required for training/inference)
90
+
91
+ ```bash
92
+ pip install git+https://github.com/FlashVision/FlashDet.git
93
+ ```
94
+
95
+ ### Development install (from source)
96
+
97
+ ```bash
98
+ git clone https://github.com/FlashVision/FlashStudio.git
99
+ cd FlashStudio
100
+ pip install -e .
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Usage — Local Machine
106
+
107
+ ### Option 1: CLI
108
+
109
+ ```bash
110
+ flashstudio --port 8501
111
+ ```
112
+
113
+ ### Option 2: Streamlit directly
114
+
115
+ ```bash
116
+ cd FlashStudio
117
+ streamlit run flashstudio/app.py
118
+ ```
119
+
120
+ Then open **http://localhost:8501** in your browser.
121
+
122
+ ---
123
+
124
+ ## Usage — Google Colab
125
+
126
+ ### Step 1: Install packages
127
+
128
+ ```python
129
+ !pip install flashstudio
130
+ !pip install git+https://github.com/FlashVision/FlashDet.git
131
+ ```
132
+
133
+ ### Step 2: Get ngrok token (free, one-time setup)
134
+
135
+ FlashStudio uses [ngrok](https://ngrok.com) to create a public URL for the Streamlit UI in Colab.
136
+
137
+ 1. **Sign up** (free): https://dashboard.ngrok.com/signup
138
+ 2. **Get your auth token**: https://dashboard.ngrok.com/get-started/your-authtoken
139
+ 3. Copy the token (looks like `2xAbC1234_something...`)
140
+
141
+ ### Step 3: Launch
142
+
143
+ ```python
144
+ from flashstudio import launch
145
+
146
+ # Pass your ngrok token
147
+ launch(ngrok_token="YOUR_NGROK_TOKEN_HERE")
148
+ ```
149
+
150
+ Or set it as an environment variable:
151
+
152
+ ```python
153
+ import os
154
+ os.environ["NGROK_TOKEN"] = "YOUR_NGROK_TOKEN_HERE"
155
+
156
+ from flashstudio import launch
157
+ launch()
158
+ ```
159
+
160
+ ### Step 4: Open the URL
161
+
162
+ After launching, you'll see output like:
163
+
164
+ ```
165
+ ============================================================
166
+ FlashStudio is running!
167
+ Local: http://localhost:8501
168
+ Public: https://abc123.ngrok-free.app
169
+ ============================================================
170
+ ```
171
+
172
+ Click the **Public URL** to open FlashStudio in a new tab.
173
+
174
+ ---
175
+
176
+ ## Google Colab Notebooks (Ready to Use)
177
+
178
+ | Notebook | Description | Link |
179
+ |----------|-------------|------|
180
+ | Training | Train FlashDet models | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FlashVision/FlashStudio/blob/main/notebooks/FlashStudio_Train.ipynb) |
181
+ | Inference | Run detection on images/video | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FlashVision/FlashStudio/blob/main/notebooks/FlashStudio_Inference.ipynb) |
182
+
183
+ ---
184
+
185
+ ## Supported Models
186
+
187
+ | Model | Params | Best For |
188
+ |-------|--------|----------|
189
+ | FlashDet-Pico | ~298K | Edge / MCU |
190
+ | FlashDet-Nano | ~790K | Embedded / IoT |
191
+ | FlashDet-Small | ~1.8M | General purpose |
192
+ | FlashDet-Medium | ~3.6M | High accuracy |
193
+ | FlashDet-Large | ~5.8M | High accuracy |
194
+ | FlashDet-X | ~9.0M | Max accuracy / Server |
195
+ | YOLOv8/v9/v10/v11/YOLOX | Varies | General YOLO |
196
+
197
+ ---
198
+
199
+ ## Architecture
200
+
201
+ ```
202
+ FlashStudio/
203
+ ├── flashstudio/
204
+ │ ├── __init__.py # Package init + launch() export
205
+ │ ├── app.py # Main Streamlit app (wizard flow)
206
+ │ ├── launcher.py # Colab/local launcher with ngrok
207
+ │ ├── cli.py # CLI entrypoint
208
+ │ ├── pages/
209
+ │ │ ├── dashboard.py # Overview + recent training runs
210
+ │ │ ├── data.py # Dataset upload/download
211
+ │ │ ├── model.py # Architecture & hyperparameter config
212
+ │ │ ├── training.py # Training monitor (reads real workspace)
213
+ │ │ ├── export.py # ONNX export
214
+ │ │ └── inference.py # 4-step inference pipeline
215
+ │ ├── components/
216
+ │ │ ├── sidebar.py # Navigation sidebar
217
+ │ │ ├── styles.py # Custom CSS
218
+ │ │ └── wizard.py # Step indicator & navigation
219
+ │ └── utils/
220
+ │ └── device.py # GPU/environment detection
221
+ ├── notebooks/
222
+ │ ├── FlashStudio_Train.ipynb
223
+ │ └── FlashStudio_Inference.ipynb
224
+ ├── .streamlit/config.toml
225
+ ├── pyproject.toml
226
+ └── README.md
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Troubleshooting
232
+
233
+ ### `ModuleNotFoundError: No module named 'pyngrok'`
234
+
235
+ ```bash
236
+ pip install --upgrade flashstudio
237
+ ```
238
+
239
+ ### ngrok authentication error (`ERR_NGROK_4018`)
240
+
241
+ You need an ngrok auth token. Get one free at:
242
+ https://dashboard.ngrok.com/get-started/your-authtoken
243
+
244
+ Then pass it to `launch(ngrok_token="your_token")`.
245
+
246
+ ### Streamlit port already in use
247
+
248
+ ```bash
249
+ # Kill existing Streamlit processes
250
+ pkill -f "streamlit run"
251
+
252
+ # Then restart
253
+ flashstudio --port 8501
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Requirements
259
+
260
+ - Python >= 3.9
261
+ - FlashDet (`pip install git+https://github.com/FlashVision/FlashDet.git`)
262
+ - ngrok account (free) for Google Colab usage
263
+ - GPU recommended for training (T4 or better)
264
+
265
+ ## License
266
+
267
+ Apache-2.0
@@ -1,5 +1,5 @@
1
1
  """FlashStudio — Interactive Training & Inference UI for FlashDet."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.2"
4
4
 
5
5
  from flashstudio.launcher import launch # noqa: F401
@@ -0,0 +1,123 @@
1
+ """FlashStudio — Main Streamlit Application."""
2
+
3
+ import streamlit as st
4
+
5
+ st.set_page_config(
6
+ page_title="FlashStudio",
7
+ page_icon="FS",
8
+ layout="wide",
9
+ initial_sidebar_state="expanded",
10
+ )
11
+
12
+ from flashstudio.components.styles import inject_custom_css # noqa: E402
13
+ from flashstudio.components.sidebar import render_sidebar # noqa: E402
14
+ from flashstudio.components.wizard import render_step_indicator, render_navigation # noqa: E402
15
+ from flashstudio.components.project_manager import ( # noqa: E402
16
+ get_active_project, render_project_manager_page,
17
+ save_project_state, list_projects, create_project,
18
+ load_project_state,
19
+ )
20
+ from flashstudio.pages.dashboard import render_dashboard # noqa: E402
21
+ from flashstudio.pages.data import render_data_page # noqa: E402
22
+ from flashstudio.pages.model import render_model_page # noqa: E402
23
+ from flashstudio.pages.training import render_training_page # noqa: E402
24
+ from flashstudio.pages.export import render_export_page # noqa: E402
25
+ from flashstudio.pages.inference import render_inference_page # noqa: E402
26
+
27
+ STEPS = [
28
+ {"id": "dashboard", "label": "Dashboard", "icon": "1"},
29
+ {"id": "data", "label": "Data", "icon": "2"},
30
+ {"id": "model", "label": "Model", "icon": "3"},
31
+ {"id": "training", "label": "Training", "icon": "4"},
32
+ {"id": "export", "label": "Export", "icon": "5"},
33
+ {"id": "inference", "label": "Inference", "icon": "6"},
34
+ ]
35
+
36
+ PAGE_RENDERERS = {
37
+ "dashboard": render_dashboard,
38
+ "data": render_data_page,
39
+ "model": render_model_page,
40
+ "training": render_training_page,
41
+ "export": render_export_page,
42
+ "inference": render_inference_page,
43
+ }
44
+
45
+
46
+ def main():
47
+ import traceback as _tb
48
+
49
+ inject_custom_css()
50
+
51
+ if "current_step" not in st.session_state:
52
+ st.session_state["current_step"] = 0
53
+
54
+ # Ensure critical config values are always initialized
55
+ from flashstudio.utils import DEFAULTS
56
+ if not st.session_state.get("save_dir"):
57
+ st.session_state["save_dir"] = DEFAULTS["save_dir"]
58
+
59
+ # Project system — check if user has an active project
60
+ active_project = get_active_project()
61
+
62
+ if active_project is None and not list_projects():
63
+ # First time user — show project creation
64
+ _render_first_time_setup()
65
+ return
66
+
67
+ # Load project state once on initial page load
68
+ if active_project and not st.session_state.get("_project_state_loaded"):
69
+ load_project_state(active_project["id"])
70
+ st.session_state["_project_state_loaded"] = True
71
+
72
+ if st.session_state.get("show_project_manager"):
73
+ render_project_manager_page()
74
+ if st.button("← Back to Workspace", key="back_from_projects"):
75
+ st.session_state["show_project_manager"] = False
76
+ st.rerun()
77
+ return
78
+
79
+ render_sidebar()
80
+ render_step_indicator(STEPS, st.session_state["current_step"])
81
+
82
+ current = STEPS[st.session_state["current_step"]]
83
+
84
+ try:
85
+ PAGE_RENDERERS[current["id"]]()
86
+ except Exception as _e:
87
+ st.error(f"Error: {_e}")
88
+ st.code(_tb.format_exc())
89
+
90
+ render_navigation(STEPS, st.session_state["current_step"])
91
+
92
+ # Auto-save project state on each page render
93
+ if active_project:
94
+ save_project_state()
95
+
96
+
97
+ def _render_first_time_setup():
98
+ """Compact first-time project creation."""
99
+ st.markdown(
100
+ "<div style='text-align:center; padding:2rem 0 0.5rem;'>"
101
+ "<b style='font-size:2.5rem;'>FS</b><br>"
102
+ "<b style='font-size:1.3rem;'>Welcome to FlashStudio</b><br>"
103
+ "<span style='color:#6B7280;font-size:0.9rem;'>Create your first project to get started</span>"
104
+ "</div>",
105
+ unsafe_allow_html=True,
106
+ )
107
+
108
+ with st.container(border=True):
109
+ col_form, col_info = st.columns([3, 2])
110
+ with col_form:
111
+ name = st.text_input("Project Name", placeholder="e.g. Traffic Detection", key="first_project_name")
112
+ desc = st.text_input("Description (optional)", placeholder="Detect vehicles in traffic footage", key="first_project_desc")
113
+ if st.button("Create and Start", type="primary", disabled=not name, use_container_width=True):
114
+ create_project(name, desc)
115
+ st.rerun()
116
+ with col_info:
117
+ st.markdown("#### What's a Project?")
118
+ for item in ["Dataset management", "Model configuration", "Training runs", "Model exports", "Inference pipeline"]:
119
+ st.markdown(f'<span style="font-size:0.84rem;color:#4B5563;">{item}</span>', unsafe_allow_html=True)
120
+
121
+
122
+ if __name__ == "__main__":
123
+ main()