agentmorris / MegaDetector

MegaDetector is an AI model that helps conservation folks spend less time doing boring things with camera trap images.
MIT License
116 stars 24 forks source link

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

Closed agentmorris closed 1 year ago

agentmorris commented 1 year 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!


Issue cloned from Microsoft/CameraTraps, original issue posted by Jonathan-Gore on Mar 08, 2020.

agentmorris commented 1 year 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


(Comment originally posted by agentmorris)

agentmorris commented 1 year ago

Awesome, thanks for the support and info!


(Comment originally posted by Jonathan-Gore)