"Grunz" aims to streamline the pre/post-processing of camera trap data via MegaDetector. The code was written to aid the work of the Institut für Ökologie at the Technische Universität Berlin.
There are two problems it seeks to solve:
As the initial research goal related to the impact of 🐖's on ecosystems in Berlin, Germany and as German pigs "grunz" and not "oink", this seemed like a fitting name :)
ModuleNotFoundError
within the cameratraps repo. Should this happen you will need to append the base directory to the offending import path.
from ct_utils import truncate_float
becomes from cameratraps.ct_utils import truncate_float
cameratraps/detection/run_tf_detector.py
from cameratraps.ct_utils import truncate_float
import cameratraps.visualization.visualization_utils as viz_utils
cameratraps/detection/run_tf_detector_batch.py
from cameratraps.detection.run_tf_detector import ImagePathUtils, TFDetector
import cameratraps.visualization.visualization_utils as viz_utils
cameratraps/visualization/visualization_utils.py
from cameratraps.data_management.annotations import annotation_constants
In the interest of getting the job done without fuss, I've tried to hide as much complexity as possible. Running "Grunz" should thus be very simple.
Create a virtual environment to avoid overwriting global dependencies.
python -m venv Grunz
If this fails for some reason you can achieve the same result by following the steps below in PyCharm:
Once this has been completed you should see a (venv)
prefix in your terminal prompt.
This is the indication you are operating within your virtual environment
git clone --recursive https://github.com/dddjjjbbb/Grunz
/ai4utils
& /cameratraps
directories respectively and run the following command.git checkout master; git pull
The easiest way to do this is via wget
wget https://lilablobssc.blob.core.windows.net/models/camera_traps/megadetector/md_v4.1.0/md_v4.1.0.pb
Note: If you do not have wget installed simply open the url above in your browser and save the file.
IMPORTANT: Ensure you save this file to the root directory of the project. i.e. it should be at the same level as main.py
Before running the command below, please note the following: If you intend to run Grunz on a machine with a GPU (which will likely be necessary at some point),
change tensorflow
to tensorflow-gpu
in the requirements.txt file before installing the dependencies.
pip install -r requirements.txt
python main.py --pre "grunz/data"
IMPORTANT: Please note, if running on a Windows machine, the path delimiter will differ. i.e. use backslashes in place of the forward slashes used in the documentation.
python main.py --post "grunz/output/20201016-0040.json"
GNU GPL v2