microsoft / CameraTraps

PyTorch Wildlife: a Collaborative Deep Learning Framework for Conservation.
https://cameratraps.readthedocs.io/en/latest/
MIT License
781 stars 246 forks source link

Successful run of visualize_detector_output.py outputs empty file "anno_" #141

Closed Jonathan-Gore closed 4 years ago

Jonathan-Gore commented 4 years ago

After successfully running the run_tf_detector_batch.py on a test-subset of 10 images I'm getting stuck after running visualize_detector_output.py.

I'm able to successfully run visualize_detector_output.py as referenced by this log:

C:\git\cameratraps>python visualization\visualize_detector_output.py G:\Datasets\Test\test.json G:\Datasets\Annotations.jpg -i G:\Datasets\Test\test.json

Options to the script: Namespace(confidence=0.8, detector_output_path='G:\Datasets\Test\test.json', images_dir='G:\Datasets\Test\test.json', out_dir='G:\Datasets\Annotations\.jpg', output_image_width=700, random_seed=None, sample=-1, sas_url=None) detection_categories provided Detector output file contains 10 entries. Starting to annotate the images... 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 17.83it/s] Rendered detection results on 10 images, saved to G:\Datasets\Annotations.jpg.

But the output of the script is an empty file "anno_G" with no discernible extension.

Where have I gone wrong!

agentmorris commented 4 years ago

Oops, there was a bug in that script when running on Windows. Fixed! Get latest and try again? Sorry about that.

FWIW, this is not the script we typically use for previewing output from our detector, we usually use:

https://github.com/microsoft/CameraTraps/blob/master/api/batch_processing/postprocessing/postprocess_batch_results.py

...which produces a nice html page, like this one:

http://dolphinvm.westus2.cloudapp.azure.com/data/snapshot-serengeti/s7-eval/postprocessing-no-gt/

...and - if you have the "right" answers for your data - can also be used to produce precision/recall analyses, like this one:

http://dolphinvm.westus2.cloudapp.azure.com/data/snapshot-serengeti/s7-eval/postprocessing-detection-gt/

Hope that helps!

-Dan

Jonathan-Gore commented 4 years ago

Awesome, thanks for the support and info!