Skip to content

Commit

Permalink
doc: add batch_detection script usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bencevans committed Jun 23, 2022
1 parent 7616086 commit 6ad6b12
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
33 changes: 32 additions & 1 deletion README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,38 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Features"
"## Command Line Interface"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Batch Detection\n",
"\n",
"CamTrapML includes a Command Line Interface (CLI) for running batch detection. The interface is designed to follow that of the MegaDetector run_batch_detection.py script, currently with some caveats. Currently the CLI assumes reccursive directory search for images and does not support image_queue which means the MegaDetector run_batch_detection.py will likely process faster. \n",
"\n",
" $ python -m camtrapml.scripts.batch_detection model_name input_dir output_json_path\n",
"\n",
"The options available for `model_name` are:\n",
"\n",
"* `md2`: MegaDetector v2\n",
"* `md3`: MegaDetector v3\n",
"* `md4`: MegaDetector v4.1\n",
"\n",
"Add `--output_relative_filenames` to output filenames relative to the `input_dir` in the output JSON.\n",
"\n",
"E.g.\n",
"\n",
" $ python -m camtrapml.scripts.batch_detection --output_relative_filenames md4 ~/Survey2022 ~/Survey2022/md.4.1.0.json \n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Programatic Usage"
]
},
{
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@

$ pip install camtrapml

## Features
## Command Line Interface

### Batch Detection

CamTrapML includes a Command Line Interface (CLI) for running batch detection. The interface is designed to follow that of the MegaDetector run_batch_detection.py script, currently with some caveats. Currently the CLI assumes reccursive directory search for images and does not support image_queue which means the MegaDetector run_batch_detection.py will likely process faster.

$ python -m camtrapml.scripts.batch_detection model_name input_dir output_json_path

The options available for `model_name` are:

* `md2`: MegaDetector v2
* `md3`: MegaDetector v3
* `md4`: MegaDetector v4.1

Add `--output_relative_filenames` to output filenames relative to the `input_dir` in the output JSON.

E.g.

$ python -m camtrapml.scripts.batch_detection --output_relative_filenames md4 ~/Survey2022 ~/Survey2022/md.4.1.0.json



## Programatic Usage

### Loading Data

Expand Down

0 comments on commit 6ad6b12

Please sign in to comment.