Skip to content

Commit bd3970b

Browse files
authored
refactor: improved sections in README and now only show history + app [no ci]
1 parent d66b5cd commit bd3970b

File tree

1 file changed

+58
-25
lines changed

1 file changed

+58
-25
lines changed

README.md

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ Below there are described some of the key features of this project, but to see w
2626

2727
## How to your train own model?
2828

29-
### Setup
29+
<details>
30+
<summary>
31+
32+
### Setup</summary>
3033

3134
When using this framework, it is a good idea to setup a virtual environment:
3235
```
@@ -39,7 +42,13 @@ Tested with Python 3.7.9, on Win10, macOS, and Ubuntu Linux operating systems.
3942

4043
Note that to activate the virtual environment on Windows instead run `./venv/Scripts/activate`.
4144

42-
### Usage
45+
</details>
46+
47+
48+
<details>
49+
<summary>
50+
51+
### Usage</summary>
4352

4453
To train a model, simply run:
4554
```
@@ -48,7 +57,13 @@ python main.py
4857

4958
The script supports multiple arguments. To see supported arguments, run `python main.py -h`.
5059

51-
### Training history
60+
</details>
61+
62+
63+
<details open>
64+
<summary>
65+
66+
### Training history</summary>
5267

5368
To visualize training history, use TensorBoard (with example):
5469
```
@@ -64,31 +79,14 @@ Best model reached a macro-averaged F1 score of 99.66 % on the validation set, a
6479

6580
**Disclaimer:** This model was only trained for testing purposes. The input features were stratified on sample-level and not patient-level, and thus validation performance will likely not represent true performance on new data. However, having a trained model enables us to test it in a Mobile app.
6681

67-
## How to test the model in a mobile app?
68-
69-
### Converting model to TF-Lite
70-
71-
In order to be able to use the trained model in a mobile app, it is necessary to convert the model to a compatible format. TensorFlow Lite is an inference engine tailored for mobile devices. To convert the model to TF-Lite, simply run this command:
72-
73-
```
74-
python dss/keras2tflite.py -m /path/to/pretrained/saved_model/ -o /path/to/save/converted/model.tflite
75-
```
76-
77-
### Model integration and testing in app
82+
</details>
7883

79-
A simple Mobile app was developed in Flutter, which demonstrates the AI in action using the accelerometer data from the mobile phone in real time:
84+
<details>
85+
<summary>
8086

81-
<p align="center" width="100%">
82-
<img src="sw_app/assets/app_snapshot_data.jpg" width="20%" height="20%"> <img src="sw_app/assets/app_snapshot_charts.jpg" width="20%" height="20%">
83-
</p>
87+
### Available datasets</summary>
8488

85-
To use the app, you need an Android phone and have developer mode enabled (see [here](https://developer.android.com/studio/debug/dev-options) for how to enable it). Then simply download the APK from [here](https://github.com/andreped/DSS/releases/tag/v0.1.0), double-click to install, and use the app as you normally would.
86-
87-
Info on how the mobile app was developed (and how to make your own app), can be found [in the wiki](https://github.com/andreped/DSS/wiki/Getting-started-with-mobile-development).
88-
89-
## Which data is available?
90-
91-
### SmartWatch Gestures
89+
#### SmartWatch Gestures
9290

9391
The current data used to train the AI model is the SmartWatch Gestures dataset,
9492
which is available in [tensorflow-datasets](https://www.tensorflow.org/datasets/catalog/smartwatch_gestures). The dataset has the
@@ -108,6 +106,41 @@ FeaturesDict({
108106
'participant': tf.uint8,
109107
})
110108
```
109+
</details>
110+
111+
112+
## How to test the model in a mobile app?
113+
114+
<details>
115+
<summary>
116+
117+
### Converting model to TF-Lite</summary>
118+
119+
In order to be able to use the trained model in a mobile app, it is necessary to convert the model to a compatible format. TensorFlow Lite is an inference engine tailored for mobile devices. To convert the model to TF-Lite, simply run this command:
120+
121+
```
122+
python dss/keras2tflite.py -m /path/to/pretrained/saved_model/ -o /path/to/save/converted/model.tflite
123+
```
124+
125+
</details>
126+
127+
128+
<details open>
129+
<summary>
130+
131+
### Model integration and testing in app</summary>
132+
133+
A simple Mobile app was developed in Flutter, which demonstrates the AI in action using the accelerometer data from the mobile phone in real time:
134+
135+
<p align="center" width="100%">
136+
<img src="sw_app/assets/app_snapshot_data.jpg" width="20%" height="20%"> <img src="sw_app/assets/app_snapshot_charts.jpg" width="20%" height="20%">
137+
</p>
138+
139+
To use the app, you need an Android phone and have developer mode enabled (see [here](https://developer.android.com/studio/debug/dev-options) for how to enable it). Then simply download the APK from [here](https://github.com/andreped/DSS/releases/tag/v0.1.0), double-click to install, and use the app as you normally would.
140+
141+
Info on how the mobile app was developed (and how to make your own app), can be found [in the wiki](https://github.com/andreped/DSS/wiki/Getting-started-with-mobile-development).
142+
143+
</details>
111144

112145
## Acknowledgements
113146

0 commit comments

Comments
 (0)