Skip to content

Commit

Permalink
Merge pull request microsoft#485 from microsoft/PreRelease
Browse files Browse the repository at this point in the history
Pre release
  • Loading branch information
zhmiao authored Apr 17, 2024
2 parents 54240c6 + fd7b3bb commit 76f3cb2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions PytorchWildlife/utils/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"save_detection_classification_json",
"save_detection_timelapse_json",
"save_detection_classification_timelapse_json",
"process_detections"
"detection_folder_separation"
]


Expand Down Expand Up @@ -312,7 +312,7 @@ def save_detection_classification_timelapse_json(
json.dump(json_results, f, indent=4)


def process_detections(json_file, destination_path, confidence_threshold):
def detection_folder_separation(json_file, destination_path, confidence_threshold):
"""
Processes detection data from a JSON file to sort images into 'Animal' or 'No_animal' directories
based on detection categories and confidence levels.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


## ✅ Update highlights (Version 1.0.2.13)
- [x] Added a file separation function. You can now automatically separate your files between animals and non-animals into different folders using our [Python demo file](demo/image_separation_demo.py) and [Jupyter demo](demo/image_separation_demo.ipynb)!
- [x] Added a file separation function. You can now automatically separate your files between animals and non-animals into different folders using our `detection_folder_separation` function. Please see the [Python demo file](demo/image_separation_demo.py) and [Jupyter demo](demo/image_separation_demo.ipynb)!
- [x] 🥳 Added Timelapse compatibility! Check the [Gradio interface](INSTALLATION.md) or [notebooks](https://github.com/microsoft/CameraTraps/blob/main/demo/image_detection_demo.ipynb).
- [x] Added Google Colab demos.
- [x] Added Snapshot Serengeti classification model into the model zoo.
Expand Down
2 changes: 1 addition & 1 deletion demo/image_separation_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
" exclude_file_path=None)\n",
"\n",
"# Separate the positive and negative detections through file copying:\n",
"pw_utils.process_detections(json_file, output_path, threshold)"
"pw_utils.detection_folder_separation(json_file, output_path, threshold)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion demo/image_separation_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@
exclude_file_path=None)

# Separate the positive and negative detections through file copying:
pw_utils.process_detections(json_file, args.output_path, args.threshold)
pw_utils.detection_folder_separation(json_file, args.output_path, args.threshold)

0 comments on commit 76f3cb2

Please sign in to comment.