Skip to content

Commit 33efb42

Browse files
committed
Major README updated, added link to demo
1 parent b28ac30 commit 33efb42

File tree

10 files changed

+24
-37
lines changed

10 files changed

+24
-37
lines changed
0 Bytes
Binary file not shown.

App/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ def post(self, request):
186186
return Response({'predictions': predictions.pop()})
187187
except ValueError as err:
188188
return Response(str(err), status=status.HTTP_400_BAD_REQUEST)
189-
190189
return Response(predictions, status=status.HTTP_200_OK)
191190

192191
@staticmethod

README.md

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,53 +14,31 @@ This is just a research project, but hope it can inspire someone to build someth
1414

1515
# How does this work?
1616

17-
## Backend
17+
## User Journey
1818

19-
The API has two endpoints:
20-
21-
1) http://127.0.0.1:8000/App/upload/
22-
2) http://127.0.0.1:8000/App/predict/
23-
24-
Using the `App/upload` endpoint, it is possible to send a file taken from the RAVDESS dataset examples. The file will be serialized and stored in the `media` folder of the server.
19+
The user journey start on the index page at ```/index/``` where it is possible to choose if
2520

26-
![Picture](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/fileupload.png)
27-
28-
Using the `App/predict` endpoint, sending the filename as input in the format shown below the API will return an array with the predictions.
21+
1) Upload a new file on the server;
22+
2) Delete a file from the server (WIP);
23+
3) Make a prediction on a file already on the server;
2924

30-
Example `App/predict` input:
25+
![Picture1](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/index.png)
3126

32-
```
33-
{"filename" : "01-01-01-01-01-01-01.wav"}
34-
```
35-
Example `App/predict` output:
36-
```
37-
HTTP 200 OK
38-
Allow: POST, OPTIONS
39-
Content-Type: application/json
40-
Vary: Accept
27+
Choosing ```Upload your audio file``` a new window will be prompted. The user will be asked to pick a file from his computer and then will be prompted with a page that will confirm that the upload has been successful.
4128

42-
[
43-
[
44-
"neutral"
45-
]
46-
]
47-
```
29+
![Picture2](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/fileupload.png)
4830

49-
![Picture2](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/predict_n.png)
31+
Choosing ```Make your prediction``` a new window will be prompted. In this window, it will be possible to see a list of the files already on the server. Following the path ```media/{filename}``` it will be also possible to listen to the audio file.
5032

51-
The model is stored in the ```models``` folder.
33+
![Picture3](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/fileselect.png)
5234

53-
The ```templates``` folder will contain a Bootstrap simple UI to interact with the API (work in progress).
35+
After clicking on ```Submit```, the user will be redirected to a modified home page that will include the prediction made by the Keras model for the file selected.
5436

55-
If you do not know how Django works, you can skip to the ``App/views.py`` file to review the high level logic of the API.
56-
57-
## Front end
58-
59-
The project includes a simple frontend to query the API, using a web interface instead of dedicated applications or tools like postman.
37+
![Picture4](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/predict.png)
6038

61-
The front end is still work in progress: below the actual mockup.
39+
# See the App in action!
6240

63-
![Picture2](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/interface2.png)
41+
There is a short demo of the first version on YouTube: https://youtu.be/86HhxTRL3_c
6442

6543
# Developers stuff
6644

@@ -74,6 +52,16 @@ The front end is still work in progress: below the actual mockup.
7452

7553
```python manage.py test```
7654

55+
**Other important topics**
56+
57+
The Keras model is stored in the ```models``` folder.
58+
59+
```gitmedia``` folder includes the pictures used for this README.
60+
61+
```media``` folder includes the audio files loaded using the server.
62+
63+
If you do not know how Django works, you can skip to the ``App/views.py`` file to review the high level logic of the API.
64+
7765
**User Stories**
7866

7967
What is the plan for the future and what it is currently ongoing: https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/projects/2

gitmedia/fileselect.png

283 KB
Loading

gitmedia/fileupload.png

-41.5 KB
Loading

gitmedia/index.png

46.8 KB
Loading

gitmedia/interface2.png

-31.7 KB
Binary file not shown.

gitmedia/predict.png

55.1 KB
Loading

gitmedia/predict_n.png

-63.3 KB
Binary file not shown.

media/01-01-01-01-01-01-01.wav

570 KB
Binary file not shown.

0 commit comments

Comments
 (0)