Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New alerte strategy #164

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

MateoLostanlen
Copy link
Member

Hello,

The counter we're currently using poses a problem if we have the following prediction sequence (0: no_fire, 1:fire):

1 0 1 1 0 1 1 1 1

We'll start transmitting images from frame 7 onwards, although the previous images are probably interesting.

What's more, we're not using our model's location information, so two FPs in different places will increase the counter together.

I therefore propose a new strategy, combining the results of N consecutive frames. As shown in the schema below, the idea is to perform an NMS on all the boxes amoung the N frames, then for each resulting box, sum up the score of each box with an intersection >0. In the schema, we sum up all the red boxes to obtain a score of 1.21.

The new detection threshold is conf_th * N, i.e. here 0.25 x 4 = 1. Only the red box is retained.

We then send the 4 frames used to make the prediction, in order not to lose any image.

NB: in this case, at frame 4, the old counter would be at 1, meaning that many images are lost.

image

@ghost
Copy link

ghost commented Jul 27, 2023

Nice of you to open a PR 🙏
When you're ready and want to get it reviewed, post a comment in this Pull Request with this message: /quack review

Copy link
Member

@fe51 fe51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the peer review !

@MateoLostanlen MateoLostanlen merged commit 6501eec into pyronear:develop Jul 31, 2023
10 of 14 checks passed
@MateoLostanlen MateoLostanlen mentioned this pull request Aug 16, 2023
MateoLostanlen added a commit that referenced this pull request Aug 16, 2023
* update header (#149)

* fix black (#150)

* Update README.md (#151)

* Promtail (#152)

* Update of the main branch before the new deployment in Ardeche (#145)

* ci on develop (#134)

* update develop tour (#135)

* fix args (#136)

* fix: Fixed script arg name in src/run.py (#138)

* clean backup by size (#141)

* clean backup by size

* black

* missing deps

* drop function

* drop function 2

* Day only (#142)

* sunset_sunrise script

* update output file path

* check if day time

* put back real api

* style

* use datetime timedelta

* Make all params availables from run (#144)

* make all params available in run

* make params availables

* put back api

* style

* put back alert_relaxation to 2

* Yolov5 (#143)

* switch to yolov5

* missing import

* style

* fix tests

* unused import

* update readme

* letterbox transform

* do not resize with pillow before pred

* style

* downgrad opencv

* wrong img name

* long line

* missing deps

* model path

* header

* lib for opencv

* create model folder

* update init

* remove hub deps

* update threshold

* feat: Added promtail service

* feat: Added promtail config file

* feat: Renamed variable

* feat: Renamed vars

* docs: Updated setup explanation

* feat: Added restart option

---------

Co-authored-by: Mateo <[email protected]>

* analyze stream timeout (#153)

* update docker img (#154)

* add utc (#155)

* fix style (#158)

* Ir day night (#159)

* set margin to 0

* drop utc

* add ir strategy

* update docstring

* fix style

* fix missing undefinded params (#161)

* Add bbox (#162)

* add bbox

* fix inference

* style

* fix vision

* style vision

* fix engine

* keep all preds

* speed up

* pass dummy loc

* switch to v8

* fix tests

* test

* drop dummy test

* new api version

* unsed import

* install git

* code quality

* use bbox branch

* use apt get

* alert relaxation 3

* New alerte strategy (#164)

* new alert system

* fix unitests

* Occlusion mask (#165)

* add occlusion mask

* trest mask

* missing args

* use cam_key

* update test

* add a test

* clip values

* install from main (#167)

* limit bbox size (#166)

* limit bbox size

* style

* use 4 frames (#168)

* don't send bbox (#169)

* prevent empty (#171)

---------

Co-authored-by: fe51 <[email protected]>
@MateoLostanlen MateoLostanlen deleted the new_alerte_strategy branch August 23, 2023 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants