Coder Social home page Coder Social logo

eibsrem / microsoftspeciesclassification Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 2.0 5.1 MB

Running inference on images to detect the species of animals and plants with the Microsoft AI for Earth Species Recognition Model

License: European Union Public License 1.1

Python 99.58% Cython 0.42%
image-recognition species-identification pytorch microsoft-ai-for-earth inference

microsoftspeciesclassification's Introduction

MicrosoftSpeciesClassification

Script to classify images of plants and animals with the image-based species recognition models provided by Microsoft AI for Earth. The code was extracted from this Microsoft repository, which can also be used for the inference on its own by following the described steps there, but it contains some more scripts which were not necessary for us and thus removed in this repository. The model is not updated anymore.

How-To

  1. Install conda / miniconda if you do not have already (see here for installation of miniconda and here for a conda cheatsheet).

  2. Create a conda environment from the environment.yml file by executing

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

and change to respective directory (cd MicrosoftSpeciesClassification)

  1. If you want to download the pretrained pytorch model manually you can do so here (409 MB). This is not mandatory since the script also offers the opportunity to download the model automatically.

  2. The same for the taxononmy file that you can download manually here

  3. Adapt api_root in the classify_images.py script. It should be the path to the cloned repository.

  4. Adapt the paths to the pytorch model, the taxonomy file and the images (folder) in the classify_images.py script (if you don't want to download the model and taxonomy files beforehand the script can do it for you, if you change the paths to the given hyperlinks)

  5. Run script

python classify_images.py
  1. Find results in classification_output.csv

Runtime

Classifying 204 images, the script run 2175 seconds (~ 36 minutes) 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.