Handgun, Shotgun and Knife using yolov4-tiny in videos as well as images. Training code, dataset and trained weight file available.
Data is Annotated using Labelme and is available in yolo format with txt files
├── data
│ ├── obj (Train dataset)
│ │ ├── Knife
│ │ ├── Handgun
│ │ └── Shotgun
│ ├── test (Test dataset)
│ │ ├── Knife
│ │ ├── Handgun
│ │ └── Shotgun
│ ├── train.txt (Train label)
│ └── test.txt (Test label)
Complete project is trained and evaluated on google colab Notebook
Training folder contain important files
├── training
│ ├── obj.data
│ ├── obj.names
│ ├── yolov4-tiny.config
│ └── yolov4-tiny.conv.29
# train your custom detector! (uncomment %%capture below if you run into memory issues or your Colab is crashing)
# %%capture
└── !./darknet detector train training/obj.data training/yolov4-tiny.cfg training/yolov4-tiny.conv.29 -dont_show -map
# run your custom detector with this command (upload an image to your google drive to test, thresh flag sets accuracy that detection must be in order to show it)
├── !./darknet detector test training/obj.data training/yolov4-tiny.cfg /mydrive/yolo/yolov4/darknet/backup/yolov4-tiny_4000.weights /mydrive/yolo/yolov4/darknet/data/test/Knife/7bc500661f0ea2c7.jpg -thresh 0.5
└── imShow('predictions.jpg')
├── tflite.ipynb