Giter VIP home page Giter VIP logo

firetrace's Introduction

title emoji colorFrom colorTo sdk python_version sdk_version app_file pinned fullWidth
Firetrace
🔥
yellow
gray
gradio
3.11
4.10.0
src/frontend_main.py
true
true

Firetrace Logo

About

Firetrace is an AI model and web interface that predicts the severity of bushfire events at a nationwide scale, by using projected weather data. It uses a deep neural network trained on data from BOM weather observatories around the country, NASA’s MODIS satellite and the Southern Oscillation Index as well as time information to represent seasonality and climate change trends.

Read the Report

Using the Model

Easiest: HuggingFace Space

Navigate to https://huggingface.co/spaces/jtpotato/firetrace. Most inputs are self-explanatory. Southern Oscillation Index uses numbers as reported by the Australian Bureau of Meteorology.

Advanced: Running Locally

  1. Clone the repository to some directory (preferably on a fast SSD, although the scale of the model means it should work well on most drives)
  2. Ensure you are using Python 3.11.x. Modify the following commands to point to Python 3.11.x if need be.
  3. Install dependencies. This may differ between installations of Python.
python3 -m pip install -r requirements.txt
  1. Run the web server with python3 src/frontend-main.py This will make http://127.0.0.1:7860 accessible via a web browser.

Very Advanced: Using Model Weights

Install PyTorch and joblib

import torch
import joblib

checkpoint = torch.load("models/firetrace_model.pt") # Directories may be different depending on specific environment.
model = FiretraceMLP(width=checkpoint['model_size'][0], depth=checkpoint['model_size'][1])

# OPTIONAL:
# compiled_model = torch.compile(model, fullgraph=True, mode="max-autotune")
# and use compiled_model instead of model. Note that this is not compatible with some environments.

model.load_state_dict(checkpoint['model_state_dict'])
model.eval() # Prepare model for inference

# Get your input data. You may choose to do this via a numpy array. Here's how we do it.
# It's quite important that the data is presented in the same order we have here.
inputs = [soi, max_t_bne, max_t_mel, max_t_cns, max_t_pth, max_t_syd, sin_month, cos_month, year]

# Prepare scalers
x_scaler = joblib.load("models/x_scaler.save")
y_scaler = joblib.load("models/y_scaler.save")

# Scale inputs (while converting to numpy array)
scaled_inputs = x_scaler.transform(np.array(inputs).reshape(1, -1))

model_output = model(torch.tensor(scaled_inputs).float())

# Interpret the following tensor as you wish.
scaled_output = y_scaler.inverse_transform(model_output.detach().numpy().reshape(1, -1))

Roadmap

See Issues

Developers

Some important notes:

  • PyTorch requires Python < 3.12 for now.

firetrace's People

Contributors

jtpotato avatar small-brain-ferret avatar

Stargazers

Cameron Poole avatar Lachlan Jowett avatar

Watchers

Kostas Georgiou avatar  avatar

firetrace's Issues

add batching support

depends on #6 to complete before proceeding

  • reduces delays from latency when making multiple inferences
  • applies to web interface only

add temperature averages (per day, nationwide)

As outlined in #6.

Using stations:

  • Melbourne: Bundoora (Latrobe University)
  • Sydney: Sydney Airport AMO
  • Brisbane: Brisbane
  • Cairns: Cairns Aero
  • Perth: Perth Metro

These temperatures will be averaged to create a nationwide temperature average. It is hoped that the model will "learn" each region's contribution to the temperature average without having to directly predict it.

add location data to model

  • allows for increased visualisation capabilities (maps, etc)
  • makes future globalisation work possible
  • increases utility of model as people can predict for a specific area

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.