gun-detection
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: rohit1309d
- License: apache-2.0
- Language: Python
- Default Branch: main
- Size: 5.42 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Introduction
This repo contains training and evaluation code of CCTV-GUN model. It uses mmdetection to train object detection models.
Requirements
We follow the installation instructions in the mmdetection documentation here. Specifically, our code requires mmcls=0.25.0, mmcv-full=1.7.0 and torch=1.13.0.
The output of conda env export > env.yml can be found in env.yml. It can be used to create a conda virtual environment with
conda env create -f env.yml
conda activate env_cc
pip install openmim
mim install mmcv-full==1.7.0
pip install -e .
Data
We use images from three datasets :
- Youtube Images
- US Real-time Gun detection dataset (USRT)
Instructions on how to download these datasets can be found in dataset_instructions.md .
Training
All of the above datasets consists of two classes : Person (class 0) and Handgun (class 1). To train a detection model on this dataset, run
bash
python tools/train.py --config <path/to/model/config.py> --dataset-config <path/to/dataset/config.py> <extra_args>
Extra args
To adjust the training batch size
<base_command> --cfg-options data.samples_per_gpu=<batch-size>
Using weights and biases to log metrics:
After you create an account in wandb, change entity and project in train.py to your wandb username and project name. Then
<base_command> --use-wandb --wandb-name <name-of-the-experiment>
Examples:
Train a Swin-T on Ytimgs (Intra-dataset)
bash
python tools/train.py --config configs/gun_detection/swin_transformer.py --dataset-config configs/_base_/datasets/gun_detection/ytimgs.py --cfg-options data.samples_per_gpu=6
Testing
To evaluate a trained model, run
bash
python tools/test.py --config <path/to/model/config.py> --dataset-config <path/to/dataset/config.py> --checkpoint <path/to/trained/model> --work-dir <path/to/save/test/scores> --eval bbox
Examples:
Evaluate a ConvNeXt trained on USRT
bash
python tools/test.py --config configs/gun_detection/convnext.py --dataset-config configs/_base/datasets/gun_detection/usrt.py --checkpoint <path/to/mgd+usrt/trained/model.pth> --work-dir <path/to/save/test/scores> --eval bbox
To save the bounding box predictions on test set , add --save-path <path/to/output/folder> to the above command.
Owner
- Name: Rohit
- Login: rohit1309d
- Kind: user
- Repositories: 1
- Profile: https://github.com/rohit1309d
IIT Kharagpur
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - name: "MMDetection Contributors" title: "OpenMMLab Detection Toolbox and Benchmark" date-released: 2018-08-22 url: "https://github.com/open-mmlab/mmdetection" license: Apache-2.0