semvec/pypi-packages huggingface dataset:
erqa 1.1.2
A full-reference quality metric for analyzing restoration methods.
Requires Python: >=3.6

# ERQA - Edge Restoration Quality Assessment

ERQA - a full-reference quality metric designed to analyze how good image and video restoration methods (SR, deblurring, denoising, etc) are restoring real details.

It is part of [MSU Video Super Resolution Benchmark](https://videoprocessing.ai/benchmarks/video-super-resolution.html) project.


## Quick start

Run `pip install erqa` and run it from command line or directly from Python code.

### Command line

```shell
python -m erqa /path/to/target.png /path/to/gt.png
```

### Python code

```python
import erqa
import cv2

# Target and gt should be uint8 arrays of equal shape (H, W, 3) in BGR format
target = cv2.imread('/path/to/target.png')
gt = cv2.imread('/path/to/gt.png')

metric = erqa.ERQA()
v = metric(target, gt)
```

## Description

The ERQA metric analyzes how details were reconstructed in an image compared to ground-truth.
 - **ERQA = 1.0** means perfect restoration
 - **ERQA = 0.0** means worst restoration

Visualization of the metric shows underlying mask showing where image is distorted.
 - **Blue** means there is a missing detail (False Negative)
 - **Red** means there is a misplaced detail (False Positive)
 - **White** means perfect details restoration (True Positive)
 - **Black** means perfect background restoration (True Negative)

![](samples/erqa_vis.png)

## Local setup

You can get source code up and running using following commands:

```shell
git clone https://github.com/msu-video-group/erqa
cd erqa
pip install -r requirements.txt
```

## Cite us

⌛**Soon**⌛
tree-guardian 0.2.0
Track the changes into the filesystem and trigger callback on changes detecting.
Keywords: tree-guardian,observe,observer,directory,changes

# Tree Guardian

Track the changes into the filesystem and trigger callback on changes 
 detecting.


## Getting Started

### Installation

```bash
pip install tree-guardian
```

### Usage (Python)

Observe the changes into your project.
```python
from tree_guardian import observe

# Target function to trigger
def cb():
    from time import time

    print('[{}] Changes detected...'.format(time()))

observe(cb)  # Run observer
```

Run in background.
```python
from time import sleep
from threading import Event
from tree_guardian import observe


# Target function to trigger
def cb():
    from time import time

    print('[{}] Changes detected...'.format(time()))


event = Event()
observe(cb, run_async=True, event=event)  # Run observer

# Type your code below...

try:
    sleep(10)  # Run for 10 seconds or until interrupted
except KeyboardInterrupt:
    event.set()
```

### Usage (Cli)

You can also use tree-guardian commands in shell. To make observe, run, for example:
```shell
tree-guardian-observe --command='[YOUR SHELL COMMAND HERE]'
```

This command supports the following params:
```shell
usage: tree-guardian-observe [-h] [-d] -c CALLBACK [-p PATH] [-e [EXCLUDE ...]]

Observe directory and trigger callback on change detection

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           run observe on debug mode; it also displays all trigger-command output
  -c [CALLBACK_COMMAND ...], --cmd [CALLBACK_COMMAND ...], --command [CALLBACK_COMMAND ...], --callback [CALLBACK_COMMAND ...], --callback-command [CALLBACK_COMMAND ...]
                        trigger command
  -p PATH, --path PATH  the observable root path
  -e [EXCLUDE ...], --exclude [EXCLUDE ...]
                        excluded files from observe

```

Call it with `--help` flag to get more details.
```shell
tree-guardian-observe --help
```