Skip to content

Commit

Permalink
Merge pull request #469 from microsoft/PytorchWildlifev1.0.2.9
Browse files Browse the repository at this point in the history
PytorchWildlife1.0.2.9
  • Loading branch information
aa-hernandez authored Apr 12, 2024
2 parents e34b0dc + ad95261 commit c6ef31a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PytorchWildlife/utils/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def save_detection_classification_json(
"clf_confidence": [float(x) for x in clf_confidence],
}
)
json.dump(json_results, f)
json.dump(json_results, f, indent=4)


def save_detection_classification_timelapse_json(
Expand Down
20 changes: 20 additions & 0 deletions demo/image_detection_colabdemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,26 @@
" exclude_category_ids=[]) # Category IDs can be found in the definition of each model."
]
},
{
"cell_type": "markdown",
"id": "20251521",
"metadata": {},
"source": [
"### 3.1 Timelapse JSON Format:\n",
"PytorchWildlife is compatible with Timelapse, a popular tool to visualize and process camera trap data. This code will output the detection results in a JSON format compatible with Timelapse:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0689bc45",
"metadata": {},
"outputs": [],
"source": [
"pw_utils.save_detection_timelapse_json(results, os.path.join(\".\",\"batch_output_timelapse.json\"),\n",
" categories=detection_model.CLASS_NAMES)"
]
},
{
"cell_type": "markdown",
"id": "a4ee1d7b",
Expand Down

0 comments on commit c6ef31a

Please sign in to comment.