Skip to content

Running inference on images to detect the species of animals and plants with a image-recognition model trained on the iNaturalist 2021 Competition

License

Notifications You must be signed in to change notification settings

EibSReM/iNaturalist_Competition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iNaturalist_Competition

Script to classify images of plants and animals with the image-based species recognition models created in the context of the paper by Van Horn et al. 2021, benchmarking different kinds of models created on basis of the dataset of the iNaturalist 2021 Comptetition. The code was extracted from this repository by deblagoj as a contribution to the iNaturalist 2017 Competition.

How-To

  1. (recommended but not absolutely necessary) create and activate own (conda) environment

  2. install packages

pip install torch torchvision 

2.1 Actually this should work, otherwise you can also use the provided conda environment file environment.yml. Run in the repository:

conda env create -f environment.yml
  1. Clone this repository
git clone https://github.com/EibSReM/iNaturalist_Competition.git

and change to respective directory

  1. Download pretrained models from the paper here (5,6 GB), mentioned in the papers repository.

  2. Unzip file with pretrained models (probably needs to be unzipped twice: first time the .tar.gz file, sedondly the .tar file in the unzipped folder from the previous step)

  3. Adapt path to pytorch model in the inference.py script (we used the model in: cvpr21_newt_pretrained_models\cvpr21_newt_pretrained_models\pt\inat2021_supervised_large_from_scratch.pth.tar)

  4. Adapt path to images (folder) in the inference.py script

  5. Run script

python inference.py
  1. Find results in Output.txt

Runtime

Classifying 258 images, the script run 81.02 seconds on a Windows 10 notebook with the following hardware specifications:

  • Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz
  • 20 GB Ram

Approach Demo

In the folder demo you can find a couple of images and a README with the expected results for demonstration purposes.

References

Van Horn G, Cole E, Beery S, Wilber K, Belongie S, Mac Aodha O, et al. (2021) Benchmarking Representation Learning for Natural World Image Collections. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition 12884‑12893. http://arxiv-export-lb.library.cornell.edu/pdf/2103.16483

About

Running inference on images to detect the species of animals and plants with a image-recognition model trained on the iNaturalist 2021 Competition

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages