To process a folder of cameratrap media with MegaDetector and export result in csv format, you can use the following command:
Windows:
md5rs.exe -f <folder_to_process> -d 0 -i -m models/md_v5a.toml -max-frames 3 -e csv
Linux/MacOS:
md5rs -f <folder_to_process> -d 0 -i -m models/md_v5a.toml -max-frames 3 -e csv
Supported export formats are csv, json.
Run md5rs -h to see all available options.
Converted onnx model from md_v5a.0.0.pt and add dynamic batch and some postprocessing.
Converted onnx model from MDV6-yolov9e.pt, MDV6-yolov9-e-1280.pt and add dynamic batch and some postprocessing.
Converted onnx model from MDV6b-yolov9c.pt and add dynamic batch and some postprocessing.
- Multiple platform and device support based on ONNX Runtime
- Support both image and video processing
- Multithread at each step
- Dynamic batch inference
| Devices (Execution Providers) | Linux | Windows | Macos |
|---|---|---|---|
| CPU (CoreML fo Apple silicon) | ✅ | ✅ | ✅ |
| Nvidia GPU (CUDA/TensorRT) | ✅ | ✅ | |
| Intel GPU/NPU (OpenVINO) | ✅ | ✅ | |
| AMD GPU(DirectML) | ✅ | ||
| Apple silicon GPU/NPU (CoreML) | ✅ |
*Other devices listed in ONNX Runtime execution providers should also be available, but are not built and tested yet.
FFmpeg binary should be automatically downloaded. In case of failure, you can download it from here
The automatically downloaded onnxruntime libs don't deliver OpenVINO support. Prebuilt ort libs can be downloaded from here
Tested on CUDA 12.6, CUDNN 9.5, TensorRT 10.2, OpenVINO 2024.3
The organize.py script is used to organize the cameratrap media into folders named with class names and blank in sequence. It takes the export result file as input and moves the media to the corresponding folders. The script can be used as follows:
python organize.py --result result.csv --guess
Sequence is determined by shoot time or filename extension pattern if shoot time is not available. Media shot in given time range is considered as a sequence. There is a guess model to determine sequence from filename extension pattern. For example, if filenames in a folder are [IMG_0001.JPG, IMG_0002.JPG, IMG_0003.MOV, IMG_0004.JPG, IMG_0005.JPG, IMG_0006.MOV...], the guessed sequence is [IMG_0001.JPG, IMG_0002.JPG, IMG_0003.MOV], [IMG_0004.JPG, IMG_0005.JPG, IMG_0006.MOV]... The guess model is experimental and may not work in all cases, use it with your own risk. You can always use the --redo option to restore.
FP16 model didn't use ANE(Accelerated Neural Engine) on Apple silicon. Use FP32 model instead.