grungecoder commited on
Commit
605cb44
Β·
1 Parent(s): 66c65bc

Configure for HF Spaces

Browse files
Files changed (2) hide show
  1. README.md +11 -88
  2. README_GITHUB.md +88 -0
README.md CHANGED
@@ -1,88 +1,11 @@
1
- # 🍼 TotTalk Cry Eval
2
-
3
- Real-time multi-model baby cry classification tool. Available as a **CLI** (terminal with live mic) and a **Gradio web app** (browser-based, deployable for free).
4
-
5
- ## Models
6
-
7
- | # | Name | Type | Source | Speed |
8
- |---|------|------|--------|-------|
9
- | 1 | **foduucom-SVC** | sklearn SVC, 194-dim MFCC features | [HuggingFace](https://huggingface.co/foduucom/baby-cry-classification) | < 1 ms |
10
- | 2 | **DistilHuBERT** | DistilHuBERT fine-tune (5 classes) | [HuggingFace](https://huggingface.co/AmeerHesham/distilhubert-finetuned-baby_cry) | ~35 ms |
11
- | 3 | **Kibalama-9c** | Wav2Vec2 fine-tune (9 classes incl. discomfort, tired, cold/hot) | [HuggingFace](https://huggingface.co/Kibalama/baby_cry_classification_model) | ~90 ms |
12
- | 4 | **YAMNet-detector** | TF Hub YAMNet (binary cry gate) | [TF Hub](https://tfhub.dev/google/yamnet/1) | < 10 ms |
13
-
14
- ## Web app (Gradio)
15
-
16
- ```bash
17
- cd cry-eval
18
- uv sync
19
- uv run python app.py
20
- ```
21
-
22
- Open `http://localhost:7860` β€” record audio from your mic or upload a file.
23
-
24
- ### Deploy for free on HuggingFace Spaces
25
-
26
- 1. Go to [huggingface.co/new-space](https://huggingface.co/new-space)
27
- 2. Select **Gradio β†’ Blank**, **CPU Basic** (free), Public visibility
28
- 3. Create the Space, then push:
29
- ```bash
30
- cp README.md README_GITHUB.md
31
- cp README_HF.md README.md
32
- git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/cry-eval
33
- git add -A && git commit -m "Configure for HF Spaces"
34
- git push hf main
35
- ```
36
- 4. Deploys automatically (~5 min first build)
37
-
38
- ## CLI (terminal)
39
-
40
- ```bash
41
- # Run with mic input
42
- uv run python main.py
43
-
44
- # Run with an audio file
45
- uv run python main.py --file path/to/cry.wav
46
-
47
- # Select specific models
48
- uv run python main.py --models svc,hubert,kibalama
49
-
50
- # Disable YAMNet gating
51
- uv run python main.py --no-yamnet-gate
52
-
53
- # Save predictions to JSONL
54
- uv run python main.py --save-log results.jsonl
55
- ```
56
-
57
- ## Requirements
58
-
59
- - Python β‰₯ 3.11
60
- - A working microphone (for live mode)
61
- - ~1 GB RAM for transformer models
62
-
63
- Model weights are auto-downloaded on first run into HuggingFace/TF Hub caches.
64
-
65
- ## Project structure
66
-
67
- ```
68
- cry-eval/
69
- β”œβ”€β”€ pyproject.toml
70
- β”œβ”€β”€ requirements.txt # for HF Spaces / pip deployments
71
- β”œβ”€β”€ README.md
72
- β”œβ”€β”€ README_HF.md # HuggingFace Spaces metadata
73
- β”œβ”€β”€ app.py # Gradio web UI
74
- β”œβ”€β”€ main.py # CLI entrypoint
75
- β”œβ”€β”€ models/
76
- β”‚ β”œβ”€β”€ base.py # abstract CryClassifier + CryPrediction
77
- β”‚ β”œβ”€β”€ foduucom_svc.py # sklearn SVC
78
- β”‚ β”œβ”€β”€ wiam_wav2vec2.py # DistilHuBERT fine-tune
79
- β”‚ β”œβ”€β”€ kibalama.py # Wav2Vec2 9-class fine-tune
80
- β”‚ β”œβ”€β”€ yamnet.py # YAMNet binary detector
81
- β”‚ └── ensemble.py # orchestrates all models
82
- β”œβ”€β”€ audio/
83
- β”‚ β”œβ”€β”€ capture.py # MicCapture + FileCapture
84
- β”‚ └── preprocess.py # MFCC, mel, resample, RMS
85
- β”œβ”€β”€ display/
86
- β”‚ └── table.py # Rich live table renderer
87
- └── weights/ # auto-downloaded (gitignored)
88
- ```
 
1
+ ---
2
+ title: TotTalk Cry Classifier
3
+ emoji: πŸ‘Ά
4
+ colorFrom: gray
5
+ colorTo: gray
6
+ sdk: gradio
7
+ sdk_version: "5.23.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README_GITHUB.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🍼 TotTalk Cry Eval
2
+
3
+ Real-time multi-model baby cry classification tool. Available as a **CLI** (terminal with live mic) and a **Gradio web app** (browser-based, deployable for free).
4
+
5
+ ## Models
6
+
7
+ | # | Name | Type | Source | Speed |
8
+ |---|------|------|--------|-------|
9
+ | 1 | **foduucom-SVC** | sklearn SVC, 194-dim MFCC features | [HuggingFace](https://huggingface.co/foduucom/baby-cry-classification) | < 1 ms |
10
+ | 2 | **DistilHuBERT** | DistilHuBERT fine-tune (5 classes) | [HuggingFace](https://huggingface.co/AmeerHesham/distilhubert-finetuned-baby_cry) | ~35 ms |
11
+ | 3 | **Kibalama-9c** | Wav2Vec2 fine-tune (9 classes incl. discomfort, tired, cold/hot) | [HuggingFace](https://huggingface.co/Kibalama/baby_cry_classification_model) | ~90 ms |
12
+ | 4 | **YAMNet-detector** | TF Hub YAMNet (binary cry gate) | [TF Hub](https://tfhub.dev/google/yamnet/1) | < 10 ms |
13
+
14
+ ## Web app (Gradio)
15
+
16
+ ```bash
17
+ cd cry-eval
18
+ uv sync
19
+ uv run python app.py
20
+ ```
21
+
22
+ Open `http://localhost:7860` β€” record audio from your mic or upload a file.
23
+
24
+ ### Deploy for free on HuggingFace Spaces
25
+
26
+ 1. Go to [huggingface.co/new-space](https://huggingface.co/new-space)
27
+ 2. Select **Gradio β†’ Blank**, **CPU Basic** (free), Public visibility
28
+ 3. Create the Space, then push:
29
+ ```bash
30
+ cp README.md README_GITHUB.md
31
+ cp README_HF.md README.md
32
+ git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/cry-eval
33
+ git add -A && git commit -m "Configure for HF Spaces"
34
+ git push hf main
35
+ ```
36
+ 4. Deploys automatically (~5 min first build)
37
+
38
+ ## CLI (terminal)
39
+
40
+ ```bash
41
+ # Run with mic input
42
+ uv run python main.py
43
+
44
+ # Run with an audio file
45
+ uv run python main.py --file path/to/cry.wav
46
+
47
+ # Select specific models
48
+ uv run python main.py --models svc,hubert,kibalama
49
+
50
+ # Disable YAMNet gating
51
+ uv run python main.py --no-yamnet-gate
52
+
53
+ # Save predictions to JSONL
54
+ uv run python main.py --save-log results.jsonl
55
+ ```
56
+
57
+ ## Requirements
58
+
59
+ - Python β‰₯ 3.11
60
+ - A working microphone (for live mode)
61
+ - ~1 GB RAM for transformer models
62
+
63
+ Model weights are auto-downloaded on first run into HuggingFace/TF Hub caches.
64
+
65
+ ## Project structure
66
+
67
+ ```
68
+ cry-eval/
69
+ β”œβ”€β”€ pyproject.toml
70
+ β”œβ”€β”€ requirements.txt # for HF Spaces / pip deployments
71
+ β”œβ”€β”€ README.md
72
+ β”œβ”€β”€ README_HF.md # HuggingFace Spaces metadata
73
+ β”œβ”€β”€ app.py # Gradio web UI
74
+ β”œβ”€β”€ main.py # CLI entrypoint
75
+ β”œβ”€β”€ models/
76
+ β”‚ β”œβ”€β”€ base.py # abstract CryClassifier + CryPrediction
77
+ β”‚ β”œβ”€β”€ foduucom_svc.py # sklearn SVC
78
+ β”‚ β”œβ”€β”€ wiam_wav2vec2.py # DistilHuBERT fine-tune
79
+ β”‚ β”œβ”€β”€ kibalama.py # Wav2Vec2 9-class fine-tune
80
+ β”‚ β”œβ”€β”€ yamnet.py # YAMNet binary detector
81
+ β”‚ └── ensemble.py # orchestrates all models
82
+ β”œβ”€β”€ audio/
83
+ β”‚ β”œβ”€β”€ capture.py # MicCapture + FileCapture
84
+ β”‚ └── preprocess.py # MFCC, mel, resample, RMS
85
+ β”œβ”€β”€ display/
86
+ β”‚ └── table.py # Rich live table renderer
87
+ └── weights/ # auto-downloaded (gitignored)
88
+ ```