Git Product home page Git Product logo

computer-vision-project's Introduction

Get Started

  1. Create a virtual environment

python3 -m venv venv

  1. Activate the virtual environment

source venv/bin/activate

  1. Install the requirements

pip install -r requirements.txt

Generate Spectrograms

The notebook Generate_Spectrograms.ipynb is used to insert gunshots into background sounds.

First the background sounds are loaded from /repo_dir/input/background. Then each background is split into 10 second segments (or windows).

For each window, a gunshot from /repo_dir/input/gushot is inserted at a random position. A given window has one gunshot from three different volume variations: 8%, 35% and 70% volume. There is a 20% chance that a window will have a non-gunshot inserted instead of a gunshot.

Gunshot (or non-gunshot) sounds are always picked at random.

The output spectrograms are saved in /repo_dir/output/spectrograms.

Classification labels are stored in /repo_dir/output/labels.csv, which is a CSV file with the following columns: file_name,label. We can load this file using a custom torch.utils.data.Dataset class, and use it to create a dataloader for training.

Output filenames are of the form:

{backgroundName}_window={index}_vol={volumeLevel}_gun={0|1}.png

Examples:

park_window=7_vol=10%_gun=1.png
crowd_window=1_vol=50%_gun=0.png

Train Models

The notebook Train_Models.ipynb is used to train models. Double_Head_EffNetV2_Training.ipynb has the dual headed Effnet model and training scripts.

computer-vision-project's People

Contributors

stanley-jovel avatar ashwin2k avatar karthik-25 avatar

Stargazers

Juan Moreno avatar  avatar

Watchers

 avatar Juan Moreno avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.