-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo.py
More file actions
29 lines (22 loc) · 859 Bytes
/
Demo.py
File metadata and controls
29 lines (22 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import librosa
import numpy as np
from tensorflow import keras
# Placeholder values, replace with your actual data and model path
audio_file_path = "path_to_your_audio_file.wav"
model_path = "path_to_your_model/voice_sculptor.h5"
# Load the model
model = keras.models.load_model(model_path)
# Function to extract features from audio file
def extract_features(file_path):
# Implement your feature extraction logic here
# ...
# Load and preprocess the audio file
features = extract_features(audio_file_path)A
# Make predictions using the model
predictions = modelA.predict(np.expand_dims(features, axis=0))
# Get the predicted labels
emotion_label = np.argmax(predictions[0])
speaker_label = np.argmax(predictions[1])
# Display the predicted labels
print("Predicted Emotion Label:", emotion_label)
print("Predicted Speaker Label:", speaker_label)