https://github.com/abhik-biswas/uwin-megadetector
Github Repository containing scripts and code used for carrying out animal species detection on UWIN images
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.4%) to scientific vocabulary
Repository
Github Repository containing scripts and code used for carrying out animal species detection on UWIN images
Basic Info
- Host: GitHub
- Owner: Abhik-Biswas
- License: mit
- Language: Jupyter Notebook
- Default Branch: main
- Size: 40.4 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Wildlife Detection with MegaDetector
This repository contains code for identifying and detecting the presence of animals in images using MegaDetector, a machine learning model designed for wildlife detection. The model is capable of recognizing animals, people, and vehicles in images, making it ideal for ecological research and conservation projects. The detections from the Megadetector model have been passed as inputs to the YOLOv5 model, which has been fine-tuned to carry out identification of species. With this tool, researchers can automate the process of analyzing large datasets of wildlife images, streamlining efforts in biodiversity monitoring and wildlife tracking. This code provides an end-to-end pipeline for image processing, from loading datasets to visualizing detections.
To get started with this project, first clone the repository to your local machine using the following command:
git clone https://github.com/Abhik-Biswas/uwin-megadetector.git
Steps to run the Megadetector Model
Install the megadetector package
pip install megadetectorThe above is supposed to install the dependencies as well. If not, the following also needs to be installed:
pip3 install torch torchvision torchaudio streamlitThen run the following script:
python -m streamlit run md_app.pySupply the Source Directory, the Destination Directory, and the name of the output
jsonfile. The Megadetector model will run inference on the the images in the directory, and store all the bounding box coordinates which detected the presence of an object with confidence greater than or equal to the set threshold.
Segregation into Empty vs. Non-Empty Images
- The notebook
Directory Builder.ipynbhelps create a copy of the directory structure (with empty folders) of the source folder in the destination specified. - Once the folder is created, open the
Empty Vs Non Empty.ipynbnotebook. Modify the file path of thejsonfile, the source folder and the destination folder, and execute the cell. This would create two sub- directories -empty_imagesandnon_empty_images, where the segregated images would be stored.
YOLOv5
The data creation process, to be fed into the YOLOv5 model is outlined here: https://docs.ultralytics.com/yolov5/tutorials/traincustomdata/#23-organize-directories
This process has been closely mimicked, and the dataset has been created using the contents in the notebook:
^YOLO-Data-Creation.*\.ipynbOnce the data has been created, the training can be started using:
python train.py --img 640 --batch 16 --epochs 3 --data UWIN.yaml --weights yolov5s.ptThis downloads pre-trained weights on the COCO Dataset, and uses them as a starting point. A custom filepath containing a more specialized set of weights can also be provided as the input to the weights argument.
Once training has been carried out, run inference using the trained weights using:
python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images --save_csv TrueAgain, a custom filepath can be specificied for both the model weights, and the image directory, on which you want to run the inference on. The
save_csvargument, if set toTrue, saves the predictions, along with the image names in acsvfile.
Owner
- Name: Abhik Biswas
- Login: Abhik-Biswas
- Kind: user
- Repositories: 2
- Profile: https://github.com/Abhik-Biswas
Data Science@IITM | Mathematics @SXCCAL | ML | DL | AI
GitHub Events
Total
- Push event: 1
Last Year
- Push event: 1