Skip to content

Commit

Permalink
add model weights and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mnpinto committed Mar 23, 2021
1 parent 490a034 commit d80b84a
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 51 deletions.
4 changes: 2 additions & 2 deletions FireHR/_nbdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"ChLin": "02_models.ipynb",
"FireHR": "02_models.ipynb",
"load_pretrained_model": "02_models.ipynb",
"get_preds": "04_predict.ipynb",
"firehr_from_banet_events": "05_cli.ipynb"}
"get_preds": "03_predict.ipynb",
"firehr_from_banet_events": "04_cli.ipynb"}

modules = ["data.py",
"models.py",
Expand Down
2 changes: 1 addition & 1 deletion FireHR/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05_cli.ipynb (unless otherwise specified).
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_cli.ipynb (unless otherwise specified).

__all__ = ['firehr_from_banet_events']

Expand Down
Binary file added FireHR/data/model512.pth
Binary file not shown.
5 changes: 3 additions & 2 deletions FireHR/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
__all__ = ['expand_filter', 'ChLin', 'FireHR', 'load_pretrained_model']

# Cell
import os
import os, sys
from fastai.vision.all import *
import FireHR

# Cell
def expand_filter(x, ks=3):
Expand Down Expand Up @@ -39,7 +40,7 @@ def forward(self, x):
return self.finalconv(x)

# Cell
_WEIGHTS = os.path.expanduser('~/.firehr/') + 'model512.pth'
_WEIGHTS = sys.modules[FireHR.__name__].__path__[0] + '/data/model512.pth'
def load_pretrained_model(weights=_WEIGHTS, ni=6, nc=1, half_precision=True, gpu=True):
model = FireHR(ni,nc)
st = torch.load(weights, map_location=torch.device('cpu'))
Expand Down
2 changes: 1 addition & 1 deletion FireHR/predict.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_predict.ipynb (unless otherwise specified).
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03_predict.ipynb (unless otherwise specified).

__all__ = ['get_preds']

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# A Practical Method for High-Resolution Burned Areas Monitoring using Sentinel-2 and VIIRS
> [placeholder]



## Install
Expand Down
6 changes: 3 additions & 3 deletions docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

summary: "Functions to use FireHR on the command line."
description: "Functions to use FireHR on the command line."
nb_path: "nbs/05_cli.ipynb"
nb_path: "nbs/04_cli.ipynb"
---
<!--
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: nbs/05_cli.ipynb
# file to edit: nbs/04_cli.ipynb
# command to build the docs after a change: nbdev_build_docs
-->
Expand Down Expand Up @@ -47,7 +47,7 @@


<div class="output_markdown rendered_html output_subarea ">
<h4 id="firehr_from_banet_events" class="doc_header"><code>firehr_from_banet_events</code><a href="https://github.com/mnpinto/FireHR/tree/master/FireHR/cli.py#L15" class="source_link" style="float:right">[source]</a></h4><blockquote><p><code>firehr_from_banet_events</code>(<strong><code>file</code></strong>:<code>Param object at 0x7f293045f610&gt;</code>, <strong><code>path</code></strong>:<code>Param object at 0x7f2930465430&gt;</code>=<em><code>'.'</code></em>, <strong><code>composite_days_before</code></strong>:<code>Param object at 0x7f28db709910&gt;</code>=<em><code>120</code></em>, <strong><code>composite_days_after</code></strong>:<code>Param object at 0x7f28db1d7f10&gt;</code>=<em><code>120</code></em>, <strong><code>max_cloud_fraction</code></strong>:<code>Param object at 0x7f28db1d7f40&gt;</code>=<em><code>None</code></em>, <strong><code>use_least_cloudy</code></strong>:<code>Param object at 0x7f28c669f340&gt;</code>=<em><code>None</code></em>, <strong><code>topography</code></strong>:<code>Param object at 0x7f28c669f2e0&gt;</code>=<em><code>False</code></em>, <strong><code>skip_preds</code></strong>:<code>Param object at 0x7f28db1e2f70&gt;</code>=<em><code>False</code></em>)</p>
<h4 id="firehr_from_banet_events" class="doc_header"><code>firehr_from_banet_events</code><a href="https://github.com/mnpinto/FireHR/tree/master/FireHR/cli.py#L15" class="source_link" style="float:right">[source]</a></h4><blockquote><p><code>firehr_from_banet_events</code>(<strong><code>file</code></strong>:<code>Param object at 0x7f5f81230b50&gt;</code>, <strong><code>path</code></strong>:<code>Param object at 0x7f5f81230df0&gt;</code>=<em><code>'.'</code></em>, <strong><code>composite_days_before</code></strong>:<code>Param object at 0x7f5f2d0a9e50&gt;</code>=<em><code>120</code></em>, <strong><code>composite_days_after</code></strong>:<code>Param object at 0x7f5f2cf46fa0&gt;</code>=<em><code>120</code></em>, <strong><code>max_cloud_fraction</code></strong>:<code>Param object at 0x7f5f2cf46f70&gt;</code>=<em><code>None</code></em>, <strong><code>use_least_cloudy</code></strong>:<code>Param object at 0x7f5f1840a3d0&gt;</code>=<em><code>None</code></em>, <strong><code>topography</code></strong>:<code>Param object at 0x7f5f1840a3a0&gt;</code>=<em><code>False</code></em>, <strong><code>skip_preds</code></strong>:<code>Param object at 0x7f5f1840a370&gt;</code>=<em><code>False</code></em>)</p>
</blockquote>

</div>
Expand Down
Loading

0 comments on commit d80b84a

Please sign in to comment.