import joblib import librosa import numpy as np

تحميل النموذج والمحولات

pipeline = joblib.load("model/voice_command_pipeline.pkl") model = pipeline['model'] scaler = pipeline['scaler']

دالة لاستخراج الميزات

def extract_features(file_path, sr=22050, n_mfcc=13): y, sr = librosa.load(file_path, sr=sr) mfccs = librosa.feature.mfcc(y=y, sr=sr, n_mfcc=n_mfcc) return np.mean(mfccs.T, axis=0)

اختبار النموذج على ملف صوتي جديد

test_file = "audio_data/wavs/وخمسة واربعون دقيقة.wav" features = extract_features(test_file) features = scaler.transform([features]) # تطبيق التوحيد prediction = model.predict(features) print(f"Predicted Command: {prediction[0]}")

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support