Skip to content

Commit

Permalink
feat: Add argument img_folder to OpenFire
Browse files Browse the repository at this point in the history
This branch remained idle for a long time.
Trying to merge with frgfm/master. Short summary of new features:

- Adding argument img_folder to OpenFire c-tor, stored in img_folder attribute (default to  previous value: root/OpenFire/images) and returned by _images property
- Adding argument --img-folder to fastai/train.py and torch/train.py
- Associated tests
  • Loading branch information
Bruno Lenzi authored and Bruno Lenzi committed May 12, 2020
2 parents e103f02 + 61e6410 commit bd02f93
Show file tree
Hide file tree
Showing 47 changed files with 3,451 additions and 255 deletions.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,42 @@ jobs:
- codecov/upload:
file: coverage.xml
flags: unittests

pkg-style:
docker:
- image: circleci/python:3.6.1

working_directory: ~/repo

steps:
- checkout

# Cached CI dependencies
- restore_cache:
keys:
- v1-deps-{{ .Branch }}-{{ checksum ".circleci/requirements.txt" }}
- v1-deps-{{ .Branch }}
- v1-deps-
- run:
name: CI dependencies installation
command: |
python3 -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r .circleci/requirements.txt
- save_cache:
when: always
paths:
- "venv"
key: v1-deps-{{ .Branch }}-{{ checksum ".circleci/requirements.txt" }}

- run:
name: Flake8
command: |
python3 -m venv venv
. venv/bin/activate
flake8 ./
docs-build:
# Preserve same environement to restore cache
docker:
Expand Down Expand Up @@ -144,6 +180,9 @@ workflows:
- pkg-test:
requires:
- pkg-build
- pkg-style:
requires:
- pkg-build
- docs-deploy:
requires:
- pkg-build
Expand Down
3 changes: 2 additions & 1 deletion .circleci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
coverage>=4.5.4
coverage>=4.5.4
flake8>=3.6.0
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 120
ignore = F401, E402, E265, F403, W503, W504, F821
exclude = venv*, .circleci, .git, docs
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,3 @@ venv.bak/

# mypy
.mypy_cache/

# version
pyronear/version.py
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# PyroNear
[![Donate](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/55423de221b14b18a5e35804574d5d5a)](https://www.codacy.com/manual/fg/pyronear?utm_source=github.com&utm_medium=referral&utm_content=frgfm/PyroNear&utm_campaign=Badge_Grade)[![CircleCI](https://circleci.com/gh/frgfm/PyroNear.svg?style=shield)](https://circleci.com/gh/frgfm/PyroNear) [![codecov](https://codecov.io/gh/frgfm/PyroNear/branch/master/graph/badge.svg)](https://codecov.io/gh/frgfm/PyroNear) [![Docs](https://img.shields.io/badge/docs-available-blue.svg)](https://frgfm.github.io/PyroNear)
![PyroNear Logo](docs/source/_static/img/pyronear-logo-dark.png)

The increasing adoption of mobile phones have significantly shortened the duration between the beginning of a wildfire and the firefighting agents being alerted. In less dense areas, limiting and minimizing this amount of time is critical to preserve forest areas.
<p align="center">
<a href="LICENSE" alt="License">
<img src="https://img.shields.io/badge/License-MIT-brightgreen.svg" /></a>
<a href="https://www.codacy.com/manual/fg/pyronear?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=frgfm/PyroNear&amp;utm_campaign=Badge_Grade">
<img src="https://api.codacy.com/project/badge/Grade/55423de221b14b18a5e35804574d5d5a"/></a>
<a href="https://circleci.com/gh/frgfm/PyroNear">
<img src="https://circleci.com/gh/frgfm/PyroNear.svg?style=shield" /></a>
<a href="https://codecov.io/gh/frgfm/PyroNear">
<img src="https://codecov.io/gh/frgfm/PyroNear/branch/master/graph/badge.svg" /></a>
<a href="https://frgfm.github.io/PyroNear">
<img src="https://img.shields.io/badge/docs-available-blue.svg" /></a>
<a href="https://pypi.org/project/pyronear/" alt="Pypi">
<img src="https://img.shields.io/badge/pypi-v0.1.0-blue.svg" /></a>
</p>

PyroNear aims at offering an wildfire early detection system with state-of-the-art performances at minimal deployment costs.


# PyroNear: 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.

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



Expand All @@ -30,10 +48,10 @@ PyroNear aims at offering an wildfire early detection system with state-of-the-a

### Installation

Use pip to install the package from git
You can install the package using [pypi](https://pypi.org/project/pyronear/) as follows:

```shell
pip install git+https://github.com/frgfm/PyroNear@master
pip install pyronear
```


Expand Down Expand Up @@ -63,7 +81,7 @@ python references/classification/fastai/train.py --help
You can then run the script with your own arguments:

```shell
python references/classification/fastai/train.py --data-path ./data --lr 3e-3 --epochs 4 --pretrained --deterministic
python references/classification/fastai/train.py --lr 3e-3 --epochs 4 --pretrained --deterministic
```

*Please note that most tasks are provided with two training scripts (and their `requirements.txt`): one using [fastai](https://github.com/fastai/fastai) and the other without it.*
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx
-e git://github.com/snide/sphinx_rtd_theme.git#egg=sphinx_rtd_theme
sphinx-rtd-theme==0.4.3
4 changes: 4 additions & 0 deletions docs/source/_static/css/custom_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ body {
background-color: #f3f4f7;
}

.wy-nav-content {
max-width: 900px;
}

.wy-nav-content-wrap, .wy-menu li.current > a {
background-color: #fff;
}
Expand Down
Binary file added docs/source/_static/img/pyronear-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

master_doc = 'index'
project = 'pyronear'
copyright = '2019, PyroNear Contibutors'
author = 'PyroNear Contibutors'
copyright = '2019, PyroNear Contributors'
author = 'PyroNear Contributors'

# The full version, including alpha/beta/rc tags
version = pyronear.__version__
Expand Down Expand Up @@ -76,9 +76,11 @@
html_theme_options = {
'collapse_navigation': False,
'display_version': True,
'logo_only': False,
'logo_only': True,
}

html_logo = '_static/img/pyronear-logo-dark.png'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
7 changes: 7 additions & 0 deletions docs/source/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@ The following datasets are available:

OpenFire
~~~~~~~~
An image classification dataset for wildfire in natural environments, built using Google Images referenced data.

.. autoclass:: OpenFire

WildFire
~~~~~~~~
A video dataset labeled with spatio-temporal keypoints for wilfire detection, built using available surveillance camera data.

.. autoclass:: WildFireDataset
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ for wildfire detection tasks.
:caption: Package Reference

datasets
models
nn
utils


Expand Down
46 changes: 46 additions & 0 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
pyronear.models
===============

The models subpackage contains definitions of models for addressing different tasks, including: image classification, object detection, and semantic segmentation.

The following models are available:

.. contents:: Models
:local:

.. currentmodule:: pyronear.models


ResNet
------

.. autofunction:: resnet18
.. autofunction:: resnet34
.. autofunction:: resnet50
.. autofunction:: resnet101
.. autofunction:: resnet152

DenseNet
---------

.. autofunction:: densenet121
.. autofunction:: densenet169
.. autofunction:: densenet161
.. autofunction:: densenet201

MobileNet v2
-------------

.. autofunction:: mobilenet_v2

ResNext
-------

.. autofunction:: resnext50_32x4d
.. autofunction:: resnext101_32x8d

Wide ResNet
-----------

.. autofunction:: wide_resnet50_2
.. autofunction:: wide_resnet101_2
18 changes: 18 additions & 0 deletions docs/source/nn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pyronear.nn
===========

The nn subpackage contains definitions of modules and functions for Deep Learning architectures.

The following models are available:

.. automodule:: torch.nn
.. currentmodule:: pyronear.nn


Pooling layers
--------------
AdaptiveConcatPool2d
~~~~~~~~~~~~~~~~~~~~

.. autoclass:: AdaptiveConcatPool2d
:members:
4 changes: 3 additions & 1 deletion pyronear/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pyronear import datasets
from pyronear import models
from pyronear import utils
from .version import __version__

from .version import __version__
3 changes: 2 additions & 1 deletion pyronear/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .openfire import OpenFire
from . import utils
from .wildfire import WildFireDataset
from . import utils
Loading

0 comments on commit bd02f93

Please sign in to comment.