Dangerous Sound Detection Network module for gunshot detection using VGG16 and transformation to spectrograms
audio_set
- samples of audiospec_set
- samples of generated spectogramsdata
- csv files from AudioSet sitemodels
- trained models and plots
numpy==1.19.5
opencv-python==4.5.1.48
tensorflow==2.4.0
pytube==10.0.0
skimage==10.0.0
keras==2.4.3
moviepy==1.0.3
librosa==0.8.0
To evaluate/train model, you will need to download the required datasets:
Or, you can easily extract all required data (transformed to spectrograms) using "extract_audio.py" module as below:
python extract_audio.py --labels_path data/labels.cvs --data_path data/data.csv --label [gunfire | screamming | clapping | ...]
Training using ours settings:
python train.py --spectrograms_dir path//to//dir//
Example of training with different settings:
python train.py --s path//to//dir// -- resize 64 --epochs 100 --batch_size 32 --class_number 5
To predict trained model you will have to load it with Keras:
model = load_model(MODEL_PATH)
and after data tranformation, evalute using predict method from Keras:
predict = model.predict(data)