Code Monkey home page Code Monkey logo

pyro-mlops's Introduction

PyroNear Logo

CI Status Documentation Status Test coverage percentage black

PyPi Status Anaconda Docker Image Version pyversions license

Pyrovision: wildfire early detection

The increasing adoption of mobile phones have significantly shortened the time required for firefighting agents to be alerted of a starting wildfire. In less dense areas, limiting and minimizing this duration remains critical to preserve forest areas.

Pyrovision aims at providing the means to create a wildfire early detection system with state-of-the-art performances at minimal deployment costs.

Quick Tour

Automatic wildfire detection in PyTorch

You can use the library like any other python package to detect wildfires as follows:

from pyrovision.models import rexnet1_0x
from torchvision import transforms
import torch
from PIL import Image


# Init
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])

tf = transforms.Compose([transforms.Resize(size=(448)), transforms.CenterCrop(size=448),
                         transforms.ToTensor(), normalize])

model = rexnet1_0x(pretrained=True).eval()

# Predict
im = tf(Image.open("path/to/your/image.jpg").convert('RGB'))

with torch.no_grad():
    pred = model(im.unsqueeze(0))
    is_wildfire = torch.sigmoid(pred).item() >= 0.5

Setup

Python 3.6 (or higher) and pip/conda are required to install PyroVision.

Stable release

You can install the last stable release of the package using pypi as follows:

pip install pyrovision

or using conda:

conda install -c pyronear pyrovision

Developer installation

Alternatively, if you wish to use the latest features of the project that haven't made their way to a release yet, you can install the package from source:

git clone https://github.com/pyronear/pyro-vision.git
pip install -e pyro-vision/.

What else

Documentation

The full package documentation is available here for detailed specifications.

Demo app

The project includes a minimal demo app using Gradio

demo_app

You can check the live demo, hosted on ๐Ÿค— HuggingFace Spaces ๐Ÿค— over here ๐Ÿ‘‡ Hugging Face Spaces

Docker container

If you wish to deploy containerized environments, a Dockerfile is provided for you build a docker image:

docker build . -t <YOUR_IMAGE_TAG>

Minimal API template

Looking for a boilerplate to deploy a model from PyroVision with a REST API? Thanks to the wonderful FastAPI framework, you can do this easily. Follow the instructions in ./api to get your own API running!

Reference scripts

If you wish to train models on your own, we provide training scripts for multiple tasks! Please refer to the ./references folder if that's the case.

Citation

If you wish to cite this project, feel free to use this BibTeX reference:

@misc{pyrovision2019,
    title={Pyrovision: wildfire early detection},
    author={Pyronear contributors},
    year={2019},
    month={October},
    publisher = {GitHub},
    howpublished = {\url{https://github.com/pyronear/pyro-vision}}
}

Contributing

Please refer to CONTRIBUTING to help grow this project!

License

Distributed under the Apache 2 License. See LICENSE for more information.

pyro-mlops's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyro-mlops's Issues

Taking into account the CO2 emissions of models training

Hi there,

Given that the Pyronear project has a low-resource approach, as we try to minimise the environmental impact of our products, it seems relevant to have an idea of the CO2 emissions associated with our training sessions.

There are various solutions for this, including codecarbon developed by some D4G volunteers.

Consequently, it would be interesting to include some related metrics in our ml ops workflow.

In this way, we could compare the performance of the training sessions in terms of estimated CO2 emissions and sum it to have estimate CO2 emission of Pyronear model training

What do you think ?

Happy to discuss it :)

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.