jpxkqx commited on
Commit
9fd6c68
1 Parent(s): 98e241e

Update contents

Browse files
Files changed (1) hide show
  1. README.md +40 -18
README.md CHANGED
@@ -12,37 +12,59 @@ pinned: false
12
 
13
  # Metric Card for Peak Signal to Noise Ratio
14
 
15
- ***Module Card Instructions:*** *Fill out the following subsections. Feel free to take a look at existing metric cards if you'd like examples.*
16
 
17
  ## Metric Description
18
- *Give a brief overview of this metric, including what task(s) it is usually used for, if any.*
 
 
 
 
 
 
 
 
 
19
 
20
  ## How to Use
21
- *Give general statement of how to use the metric*
22
 
23
- *Provide simplest possible example for using the metric*
 
 
 
 
 
 
 
24
 
25
  ### Inputs
26
- *List all input arguments in the format below*
27
- - **input_field** *(type): Definition of input, with explanation if necessary. State any default value(s).*
28
 
29
- ### Output Values
 
 
 
 
 
30
 
31
- *Explain what this metric outputs and provide an example of what the metric output looks like. Modules should return a dictionary with one or multiple key-value pairs, e.g. {"bleu" : 6.02}*
32
 
33
- *State the range of possible values that the metric's output can take, as well as what in that range is considered good. For example: "This metric can take on any value between 0 and 100, inclusive. Higher scores are better."*
 
34
 
35
- #### Values from Popular Papers
36
- *Give examples, preferrably with links to leaderboards or publications, to papers that have reported this metric, along with the values they have reported.*
37
 
38
- ### Examples
39
- *Give code examples of the metric being used. Try to include examples that clear up any potential ambiguity left from the metric description above. If possible, provide a range of examples that show both typical and atypical results, as well as examples where a variety of input parameters are passed.*
 
 
 
40
 
41
- ## Limitations and Bias
42
- *Note any known limitations or biases that the metric has, with links and references if possible.*
43
 
44
- ## Citation
45
- *Cite the source where this metric was introduced.*
46
 
47
  ## Further References
48
- *Add any useful further references.*
 
 
 
 
 
 
12
 
13
  # Metric Card for Peak Signal to Noise Ratio
14
 
15
+
16
 
17
  ## Metric Description
18
+ It is the ratio between the maximum possible power of a signal and the power of
19
+ corrupting noise that affects the fidelity of its representation. This metric is
20
+ commonly used to measure the quality of images generated by models.
21
+
22
+ - Super-Resolution
23
+ - Image Denoising
24
+ - Image Compression
25
+
26
+ PSNR is a measure of the quality of reconstruction of an image. The higher the PSNR, the
27
+ better the quality of the image.
28
 
29
  ## How to Use
 
30
 
31
+ At minimum, this metric requires predictions and references as inputs.
32
+
33
+ ```python
34
+ import evaluate
35
+
36
+ psnr = evaluate.load("jpxkqx/peak_signal_to_noise_ratio")
37
+ psnr.compute(predictions=[[0.0, 0.1], [0.1, 0.9]], references=[[0.0, 0.2], [0.1, 0.8]])
38
+ ```
39
 
40
  ### Inputs
 
 
41
 
42
+ - **predictions** *('np.array'): Predictions to evaluate.*
43
+ - **references** *('np.array'): True image to consider as baseline.*
44
+ - **data_range** *('float'): The data range of the images (distance between the minimum
45
+ and maximum possible values). If not provided, it is determined from the image data-type.*
46
+ - **sample_weight** *('list'): Sample weights default to None.*
47
+
48
 
49
+ ### Output Values
50
 
51
+ - **psnr** *('float'): Peak Signal to Noise Ratio, which it is expressed as a
52
+ logarithmic quantity using the decibel scale.*
53
 
54
+ Outputs example:
 
55
 
56
+ ```python
57
+ {'psnr': 35.23}
58
+ ```
59
+ Typical values for the PSNR in lossy image and video compression are between 30 and 50
60
+ dB, provided the bit depth is 8 bits.
61
 
 
 
62
 
 
 
63
 
64
  ## Further References
65
+
66
+
67
+ [Peak Signal to Noise Ratio (PSNR) - Wikipedia](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio)
68
+ [Peak Signal to Noise Ratio (PSNR) - scikit-image](https://scikit-image.org/docs/dev/api/skimage.metrics.html#skimage.metrics.peak_signal_noise_ratio)
69
+ [Peak Signal to Noise Ratio (PSNR) - PyTorch](https://pytorch.org/ignite/generated/ignite.metrics.PSNR.html)
70
+ [Peak Signal to Noise Ratio (PSNR) - TensorFlow](https://www.tensorflow.org/api_docs/python/tf/image/psnr)