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

Color code events in timeline based on priority #687

Closed
ivelin opened this issue Aug 6, 2021 · 8 comments
Closed

Color code events in timeline based on priority #687

ivelin opened this issue Aug 6, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@ivelin
Copy link
Contributor

ivelin commented Aug 6, 2021

Is your feature request related to a problem? Please describe.
Currently all events show with blue / INFO color in timeline. Whether a person was detected or a fall was detected, the color coding of the circular event icon in the upper left corner is the same. See screenshot.

Ability to filter events based on priority would be also helpful for notifications.

Describe the solution you'd like
It would be desirable to color code event icons based on priority values: INFO, WARNING so its easier for users to spot more important events faster.

See example JSON payloads of events sent from an edge device. Notice the priority parameter.

- args:
    datetime: '2021-03-24T05:15:57.722352'
    id: 5906a1d5bdc14a1daadd2555b39bd0f3
    image_file_name: 20210324-051557.722352-image.jpg
    inference_meta:
      display: Object Detection
    inference_result:
     ...
  priority: INFO

The PWA code is already designed to color code icons based on event priority level (see this).

However the edge device code always logs events at info level (see this).
The event level is then picked up by the event formatter and saved in the timeline event yaml log file (see this).

As an initial step, we can add a priority argument to the edge pipeline configuration yaml, that sets the default priority level for each type of detection event. For example:

     - detect_falls: # look for falls
        ai_model: fall_detection
        confidence_threshold: 0.6
        priority : WARNING    # default priority of the event, one of: INFO, WARNING or CRITICAL

Then the event logger in store.py can save each event at the configured priority / log level, which should result in the correct color coding in the UI.

Here is the corresponding ambianic-edge issue.

Describe alternatives you've considered
A more advanced version of this feature would allow users to edit the default priority level for various types of events. For example for certain scenarios person detection maybe just at INFO level (counting people appearances in a living room), but in others it may be a WARNING priority (people breaching of a security perimeter at night).

Additional context
Yet another feature to consider is the ability to mute events under a certain priority threshold. For example a user may only want to be notified about WARNING level events and not INFO events.

Screen Shot 2021-08-06 at 7 30 52 AM

@vickywane
Copy link
Contributor

@ivelin I will take this up and submit a PR when implemented.

@vickywane
Copy link
Contributor

The PWA code is already designed to color code icons based on event priority level (see this).

@ivelin There's a missing link here

@vickywane
Copy link
Contributor

@ivelin I'm going through this gradually, and a fix for this feature request still seems unclear to me.

As an initial step, we can add a priority argument to the edge pipeline configuration yaml, that sets the default priority level for >each type of detection event. For example:

    - detect_falls: # look for falls
       ai_model: fall_detection
       confidence_threshold: 0.6
       priority : WARNING    # default priority of the event, one of: INFO, WARNING or CRITICAL

If this will be a fix to this issue, then this issue should have been opened in the edge repository.

On the second hand, should the priority level be sent to the edge-device from the PWA?

@ivelin
Copy link
Contributor Author

ivelin commented Aug 22, 2021

The PWA code is already designed to color code icons based on event priority level (see this).

@ivelin There's a missing link here

Here it is. We can move this switch to the EventIcon component.

eventColor (event) {

@ivelin
Copy link
Contributor Author

ivelin commented Aug 22, 2021

Yes, this will involve updates on both edge and UI. We need a separate ambianic-edge issue that links to this one.

As an initial step, we can add the suggested config.yaml attribute on the edge. That will enable reasonable default behavior. When implemented , we still need a thorough test coverage on the UI side to ensure edge events with different priorities are processed and displayed correctly.

We can create follow-up feature requests that allow users to do several things via the UI:

  • Set a system wide or edge-device-scoped minimum event priority level above which edge devices should fire events. Respectively edge devices will be expected to ignore firing events below a certain level. This needs to be though through. Maybe one threshold for real-time notifications and another threshold for logging events in the timeline history so users can still search for lower level events if they want to only get notified on higher priority events.
  • Assign event priority per type of detection event. This will update the config attributes on the edge device. For some users and situations, it may be more important to detect falls, while for others it may be more important to detect person identifies.

Thoughts?

@ivelin I'm going through this gradually, and a fix for this feature request still seems unclear to me.

As an initial step, we can add a priority argument to the edge pipeline configuration yaml, that sets the default priority level for >each type of detection event. For example:

    - detect_falls: # look for falls
       ai_model: fall_detection
       confidence_threshold: 0.6
       priority : WARNING    # default priority of the event, one of: INFO, WARNING or CRITICAL

If this will be a fix to this issue, then this issue should have been opened in the edge repository.

On the second hand, should the priority level be sent to the edge-device from the PWA?

@vickywane
Copy link
Contributor

Thoughts?

I am resuming work on this.
I will break the issue down into smaller chunks. I have started off with the first part on the Ambianic Edge in this pull request.

@ivelin
Copy link
Contributor Author

ivelin commented Nov 2, 2021

Breaking it down into smaller PRs is fine, but each has to add a meaningful improvement that is well tested. Tests should demonstrate clearly how the change is expected to work and be used by other upcoming PRs.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 16, 2022
@stale stale bot closed this as completed Apr 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants