Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -6,70 +6,128 @@ emoji: 😻
|
|
6 |
colorFrom: purple
|
7 |
colorTo: green
|
8 |
short_description: Detect AI-generated music vs human-created music using advan
|
|
|
9 |
---
|
10 |
-
title: AI Music Detection
|
11 |
-
emoji: 🎵
|
12 |
-
colorFrom: blue
|
13 |
-
colorTo: purple
|
14 |
-
sdk: streamlit
|
15 |
-
sdk_version: "1.28.1"
|
16 |
-
app_file: app.py
|
17 |
-
pinned: false
|
18 |
|
19 |
-
# Madverse Music: AI Music Detection
|
20 |
|
21 |
-
|
22 |
|
23 |
## What is Madverse Music?
|
24 |
|
25 |
-
Madverse Music is an AI-powered
|
26 |
|
27 |
## Key Features
|
28 |
|
29 |
-
-
|
30 |
-
- Web interface for easy testing
|
31 |
-
- REST API for integration
|
32 |
- High accuracy: 97% F1 score with 96% sensitivity and 99% specificity
|
33 |
-
- Supports WAV, MP3, FLAC, M4A, and OGG files
|
34 |
- Uses SpecTTTra transformer technology
|
35 |
- Trained on 97,000+ songs
|
|
|
|
|
36 |
|
37 |
## Quick Start
|
38 |
|
39 |
-
###
|
40 |
-
1. Go to our Hugging Face Space
|
41 |
-
2. Upload your audio file
|
42 |
-
3. Get instant results
|
43 |
|
44 |
-
### Local Setup
|
45 |
```bash
|
46 |
# Install dependencies
|
47 |
pip install -r requirements.txt
|
48 |
|
49 |
-
# Start
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
53 |
-
python api.py
|
54 |
-
```
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
59 |
|
|
|
60 |
```bash
|
61 |
-
|
|
|
|
|
|
|
62 |
```
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
## Model Performance
|
75 |
|
@@ -83,41 +141,50 @@ Our model (SpecTTTra-α 120s) achieves:
|
|
83 |
- Model: SpecTTTra (Spectro-Temporal Tokens Transformer)
|
84 |
- Sample Rate: 16kHz
|
85 |
- Max Duration: 120 seconds
|
86 |
-
-
|
|
|
|
|
87 |
|
88 |
-
## API
|
89 |
|
90 |
-
|
91 |
-
```bash
|
92 |
-
# Health check
|
93 |
-
curl https://your-space-name.hf.space/health
|
94 |
|
95 |
-
|
96 |
-
curl -X POST "https://your-space-name.hf.space/analyze" \
|
97 |
-
-F "[email protected]"
|
98 |
-
```
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
104 |
|
105 |
-
|
106 |
-
python api.py
|
107 |
-
```
|
108 |
|
109 |
-
|
|
|
|
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
```
|
118 |
|
119 |
## Acknowledgments
|
120 |
|
121 |
-
This
|
122 |
|
123 |
-
Visit [madverse.co](https://madverse.co) for more information.
|
|
|
6 |
colorFrom: purple
|
7 |
colorTo: green
|
8 |
short_description: Detect AI-generated music vs human-created music using advan
|
9 |
+
sdk_version: 1.46.1
|
10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
# Madverse Music: AI Music Detection API
|
13 |
|
14 |
+
AI-powered REST API to detect AI-generated music vs human-created music using advanced transformer technology.
|
15 |
|
16 |
## What is Madverse Music?
|
17 |
|
18 |
+
Madverse Music is an AI-powered REST API that can detect whether music is created by AI or human artists. With the growth of AI music generation platforms like Suno and Udio, it's important to distinguish between human creativity and artificial intelligence.
|
19 |
|
20 |
## Key Features
|
21 |
|
22 |
+
- REST API for seamless integration
|
|
|
|
|
23 |
- High accuracy: 97% F1 score with 96% sensitivity and 99% specificity
|
24 |
+
- Supports WAV, MP3, FLAC, M4A, and OGG files via URL
|
25 |
- Uses SpecTTTra transformer technology
|
26 |
- Trained on 97,000+ songs
|
27 |
+
- Concurrent processing for multiple files
|
28 |
+
- Built with FastAPI for automatic documentation
|
29 |
|
30 |
## Quick Start
|
31 |
|
32 |
+
### Installation
|
|
|
|
|
|
|
33 |
|
|
|
34 |
```bash
|
35 |
# Install dependencies
|
36 |
pip install -r requirements.txt
|
37 |
|
38 |
+
# Start the API server
|
39 |
+
python app.py
|
40 |
+
```
|
41 |
+
|
42 |
+
The API will be available at `http://localhost:8000` with automatic documentation.
|
43 |
+
|
44 |
+
## API Endpoints
|
45 |
+
|
46 |
+
### Health Check
|
47 |
+
```bash
|
48 |
+
GET /health
|
49 |
+
```
|
50 |
+
|
51 |
+
### Get API Information
|
52 |
+
```bash
|
53 |
+
GET /info
|
54 |
+
```
|
55 |
+
|
56 |
+
### Analyze Music
|
57 |
+
```bash
|
58 |
+
POST /analyze
|
59 |
+
```
|
60 |
|
61 |
+
## Authentication
|
|
|
|
|
62 |
|
63 |
+
All API requests require an API key in the header:
|
64 |
|
65 |
+
```bash
|
66 |
+
X-API-Key: madverse-music-api-key-2024
|
67 |
+
```
|
68 |
+
|
69 |
+
## Usage Examples
|
70 |
|
71 |
+
### Single File Analysis
|
72 |
```bash
|
73 |
+
curl -X POST "http://localhost:8000/analyze" \
|
74 |
+
-H "X-API-Key: madverse-music-api-key-2024" \
|
75 |
+
-H "Content-Type: application/json" \
|
76 |
+
-d '{"urls": ["https://example.com/song.mp3"]}'
|
77 |
```
|
78 |
|
79 |
+
### Multiple Files Analysis
|
80 |
+
```bash
|
81 |
+
curl -X POST "http://localhost:8000/analyze" \
|
82 |
+
-H "X-API-Key: madverse-music-api-key-2024" \
|
83 |
+
-H "Content-Type: application/json" \
|
84 |
+
-d '{"urls": ["https://example.com/song1.mp3", "https://example.com/song2.wav"]}'
|
85 |
+
```
|
86 |
|
87 |
+
### Python Example
|
88 |
+
```python
|
89 |
+
import requests
|
90 |
+
|
91 |
+
headers = {
|
92 |
+
'X-API-Key': 'madverse-music-api-key-2024',
|
93 |
+
'Content-Type': 'application/json'
|
94 |
+
}
|
95 |
+
|
96 |
+
data = {
|
97 |
+
'urls': ['https://example.com/your-song.mp3']
|
98 |
+
}
|
99 |
+
|
100 |
+
response = requests.post('http://localhost:8000/analyze',
|
101 |
+
headers=headers, json=data)
|
102 |
+
result = response.json()
|
103 |
+
print(result)
|
104 |
+
```
|
105 |
+
|
106 |
+
## Response Format
|
107 |
+
|
108 |
+
```json
|
109 |
+
{
|
110 |
+
"success": true,
|
111 |
+
"total_files": 1,
|
112 |
+
"successful_analyses": 1,
|
113 |
+
"failed_analyses": 0,
|
114 |
+
"results": [
|
115 |
+
{
|
116 |
+
"url": "https://example.com/song.mp3",
|
117 |
+
"success": true,
|
118 |
+
"classification": "Real",
|
119 |
+
"confidence": 0.85,
|
120 |
+
"probability": 0.15,
|
121 |
+
"raw_score": -1.73,
|
122 |
+
"duration": 30.5,
|
123 |
+
"message": "🎤 Detected as real music",
|
124 |
+
"processing_time": 2.34
|
125 |
+
}
|
126 |
+
],
|
127 |
+
"total_processing_time": 2.45,
|
128 |
+
"message": "🎤 Detected as real music"
|
129 |
+
}
|
130 |
+
```
|
131 |
|
132 |
## Model Performance
|
133 |
|
|
|
141 |
- Model: SpecTTTra (Spectro-Temporal Tokens Transformer)
|
142 |
- Sample Rate: 16kHz
|
143 |
- Max Duration: 120 seconds
|
144 |
+
- Max File Size: 100MB per file
|
145 |
+
- Max Files per Request: 50
|
146 |
+
- Concurrent Processing: Up to 5 files simultaneously
|
147 |
|
148 |
+
## API Documentation
|
149 |
|
150 |
+
When the server is running, visit `http://localhost:8000` for interactive API documentation (Swagger UI) or `http://localhost:8000/docs` for ReDoc format.
|
|
|
|
|
|
|
151 |
|
152 |
+
## Supported Formats
|
|
|
|
|
|
|
153 |
|
154 |
+
- MP3 (.mp3)
|
155 |
+
- WAV (.wav)
|
156 |
+
- FLAC (.flac)
|
157 |
+
- M4A (.m4a)
|
158 |
+
- OGG (.ogg)
|
159 |
|
160 |
+
## Rate Limits
|
|
|
|
|
161 |
|
162 |
+
- Maximum 50 URLs per request
|
163 |
+
- Maximum 100MB per file
|
164 |
+
- 5 concurrent downloads per request
|
165 |
|
166 |
+
## Error Handling
|
167 |
+
|
168 |
+
The API provides detailed error messages for:
|
169 |
+
- Invalid API keys (401)
|
170 |
+
- File too large (413)
|
171 |
+
- Unsupported formats (400)
|
172 |
+
- Network errors (400)
|
173 |
+
- Processing errors (500)
|
174 |
|
175 |
+
## Environment Variables
|
176 |
+
|
177 |
+
- `MADVERSE_API_KEY`: Set custom API key (default: "madverse-music-api-key-2024")
|
178 |
+
|
179 |
+
## Testing
|
180 |
+
|
181 |
+
```bash
|
182 |
+
# Run API tests
|
183 |
+
python test_api.py
|
184 |
```
|
185 |
|
186 |
## Acknowledgments
|
187 |
|
188 |
+
This API is designed for research, education, and transparency in AI music detection. Results may vary depending on audio quality and content type.
|
189 |
|
190 |
+
Visit [madverse.co](https://madverse.co) for more information.
|