Parcourir la source

FR IQA updates

Jérôme BUISINE il y a 5 ans
Parent
commit
5cfa098fb3
35 fichiers modifiés avec 181 ajouts et 81 suppressions
  1. BIN
      docs/build/doctrees/environment.pickle
  2. BIN
      docs/build/doctrees/index.doctree
  3. BIN
      docs/build/doctrees/ipfml/ipfml.iqa.fr.doctree
  4. 1 1
      docs/build/html/.buildinfo
  5. 2 2
      docs/build/html/_modules/index.html
  6. 2 2
      docs/build/html/_modules/ipfml/exceptions.html
  7. 2 2
      docs/build/html/_modules/ipfml/filters/noise.html
  8. 41 11
      docs/build/html/_modules/ipfml/iqa/fr.html
  9. 2 2
      docs/build/html/_modules/ipfml/metrics.html
  10. 2 2
      docs/build/html/_modules/ipfml/processing.html
  11. 2 2
      docs/build/html/_modules/ipfml/utils.html
  12. 1 1
      docs/build/html/_sources/index.rst.txt
  13. 2 1
      docs/build/html/_sources/ipfml/ipfml.iqa.fr.rst.txt
  14. 1 1
      docs/build/html/_static/documentation_options.js
  15. 2 2
      docs/build/html/contributing.html
  16. 2 2
      docs/build/html/description.html
  17. 2 2
      docs/build/html/examples.html
  18. 7 3
      docs/build/html/genindex.html
  19. 3 3
      docs/build/html/index.html
  20. 2 2
      docs/build/html/ipfml.html
  21. 2 2
      docs/build/html/ipfml/ipfml.exceptions.html
  22. 2 2
      docs/build/html/ipfml/ipfml.filters.noise.html
  23. 45 11
      docs/build/html/ipfml/ipfml.iqa.fr.html
  24. 2 2
      docs/build/html/ipfml/ipfml.metrics.html
  25. 2 2
      docs/build/html/ipfml/ipfml.processing.html
  26. 2 2
      docs/build/html/ipfml/ipfml.utils.html
  27. BIN
      docs/build/html/objects.inv
  28. 2 2
      docs/build/html/py-modindex.html
  29. 2 2
      docs/build/html/search.html
  30. 1 1
      docs/build/html/searchindex.js
  31. 2 2
      docs/source/conf.py
  32. 1 1
      docs/source/index.rst
  33. 2 1
      docs/source/ipfml/ipfml.iqa.fr.rst
  34. 39 9
      ipfml/iqa/fr.py
  35. 1 1
      setup.py

BIN
docs/build/doctrees/environment.pickle


BIN
docs/build/doctrees/index.doctree


BIN
docs/build/doctrees/ipfml/ipfml.iqa.fr.doctree


+ 1 - 1
docs/build/html/.buildinfo

@@ -1,4 +1,4 @@
 # Sphinx build info version 1
 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 7fad5c3bce03c8da11b5d19ca87e04af
+config: 6b7800df1ffc7c6d3571a8c4f570c89d
 tags: 645f666f9bcd5a90fca523b33c5a78b7

+ 2 - 2
docs/build/html/_modules/index.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Overview: module code &mdash; IPFML v0.2.8 documentation</title>
+  <title>Overview: module code &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/exceptions.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.exceptions &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.exceptions &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/filters/noise.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.filters.noise &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.filters.noise &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

Fichier diff supprimé car celui-ci est trop grand
+ 41 - 11
docs/build/html/_modules/ipfml/iqa/fr.html


+ 2 - 2
docs/build/html/_modules/ipfml/metrics.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.metrics &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.metrics &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/processing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.processing &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.processing &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/utils.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.utils &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.utils &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 1 - 1
docs/build/html/_sources/index.rst.txt

@@ -14,7 +14,7 @@ Image Processing For Machine Learning
 What's IPFML ?
 =================
 
-IPFML is a python ackage developed during a thesis project.
+IPFML is a python package developed during a thesis project.
 
 .. toctree::
    :maxdepth: 3

+ 2 - 1
docs/build/html/_sources/ipfml/ipfml.iqa.fr.rst.txt

@@ -12,8 +12,9 @@ ipfml.iqa.fr
       mae
       ms_ssim
       mse
-      pnsr
+      psnr
       rmse
+      ssim
       vif
    
    

+ 1 - 1
docs/build/html/_static/documentation_options.js

@@ -1,6 +1,6 @@
 var DOCUMENTATION_OPTIONS = {
     URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
-    VERSION: 'v0.2.8',
+    VERSION: 'v0.2.9',
     LANGUAGE: 'None',
     COLLAPSE_INDEX: false,
     FILE_SUFFIX: '.html',

+ 2 - 2
docs/build/html/contributing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Contributing &mdash; IPFML v0.2.8 documentation</title>
+  <title>Contributing &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/description.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Description &mdash; IPFML v0.2.8 documentation</title>
+  <title>Description &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/examples.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Examples &mdash; IPFML v0.2.8 documentation</title>
+  <title>Examples &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 7 - 3
docs/build/html/genindex.html

@@ -9,7 +9,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Index &mdash; IPFML v0.2.8 documentation</title>
+  <title>Index &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           
@@ -304,7 +304,7 @@
 <h2 id="P">P</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="ipfml/ipfml.iqa.fr.html#ipfml.iqa.fr.pnsr">pnsr() (in module ipfml.iqa.fr)</a>
+      <li><a href="ipfml/ipfml.iqa.fr.html#ipfml.iqa.fr.psnr">psnr() (in module ipfml.iqa.fr)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -331,6 +331,10 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="ipfml/ipfml.filters.noise.html#ipfml.filters.noise.salt_pepper_noise">salt_pepper_noise() (in module ipfml.filters.noise)</a>
+</li>
+  </ul></td>
+  <td style="width: 33%; vertical-align: top;"><ul>
+      <li><a href="ipfml/ipfml.iqa.fr.html#ipfml.iqa.fr.ssim">ssim() (in module ipfml.iqa.fr)</a>
 </li>
   </ul></td>
 </tr></table>

+ 3 - 3
docs/build/html/index.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Image Processing For Machine Learning &mdash; IPFML v0.2.8 documentation</title>
+  <title>Image Processing For Machine Learning &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           
@@ -159,7 +159,7 @@
 </div>
 <div class="section" id="what-s-ipfml">
 <h1>What’s IPFML ?<a class="headerlink" href="#what-s-ipfml" title="Permalink to this headline">¶</a></h1>
-<p>IPFML is a python ackage developed during a thesis project.</p>
+<p>IPFML is a python package developed during a thesis project.</p>
 <div class="toctree-wrapper compound">
 <p class="caption"><span class="caption-text">Contents:</span></p>
 <ul>

+ 2 - 2
docs/build/html/ipfml.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Documentation &mdash; IPFML v0.2.8 documentation</title>
+  <title>Documentation &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.exceptions.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.exceptions &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.exceptions &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.filters.noise.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.filters.noise &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.filters.noise &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 45 - 11
docs/build/html/ipfml/ipfml.iqa.fr.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.iqa.fr &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.iqa.fr &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           
@@ -186,13 +186,16 @@
 <tr class="row-odd"><td><a class="reference internal" href="#ipfml.iqa.fr.mse" title="ipfml.iqa.fr.mse"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mse</span></code></a>(img_true,&nbsp;img_test)</td>
 <td>Returns Mean-Squared Error score between two Numpy arrays</td>
 </tr>
-<tr class="row-even"><td><a class="reference internal" href="#ipfml.iqa.fr.pnsr" title="ipfml.iqa.fr.pnsr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pnsr</span></code></a>(img_true,&nbsp;img_test)</td>
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.iqa.fr.psnr" title="ipfml.iqa.fr.psnr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">psnr</span></code></a>(img_true,&nbsp;img_test)</td>
 <td>Returns the computed Peak Signal to Noise Ratio (PSNR) between two images</td>
 </tr>
 <tr class="row-odd"><td><a class="reference internal" href="#ipfml.iqa.fr.rmse" title="ipfml.iqa.fr.rmse"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rmse</span></code></a>(img_true,&nbsp;img_test)</td>
 <td>Returns Root Mean-Squared Error score between two Numpy arrays</td>
 </tr>
-<tr class="row-even"><td><a class="reference internal" href="#ipfml.iqa.fr.vif" title="ipfml.iqa.fr.vif"><code class="xref py py-obj docutils literal notranslate"><span class="pre">vif</span></code></a>(img_true,&nbsp;img_test)</td>
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.iqa.fr.ssim" title="ipfml.iqa.fr.ssim"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ssim</span></code></a>(img_true,&nbsp;img_test)</td>
+<td>Returns the computed Structural Similarity (SSIM) between two images</td>
+</tr>
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.iqa.fr.vif" title="ipfml.iqa.fr.vif"><code class="xref py py-obj docutils literal notranslate"><span class="pre">vif</span></code></a>(img_true,&nbsp;img_test)</td>
 <td>Implemented later..</td>
 </tr>
 </tbody>
@@ -272,8 +275,8 @@
 </dd></dl>
 
 <dl class="function">
-<dt id="ipfml.iqa.fr.pnsr">
-<code class="descclassname">ipfml.iqa.fr.</code><code class="descname">pnsr</code><span class="sig-paren">(</span><em>img_true</em>, <em>img_test</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/iqa/fr.html#pnsr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.iqa.fr.pnsr" title="Permalink to this definition">¶</a></dt>
+<dt id="ipfml.iqa.fr.psnr">
+<code class="descclassname">ipfml.iqa.fr.</code><code class="descname">psnr</code><span class="sig-paren">(</span><em>img_true</em>, <em>img_test</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/iqa/fr.html#psnr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.iqa.fr.psnr" title="Permalink to this definition">¶</a></dt>
 <dd><p>Returns the computed Peak Signal to Noise Ratio (PSNR) between two images</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -293,11 +296,11 @@
 <p class="rubric">Example</p>
 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">ipfml.iqa</span> <span class="k">import</span> <span class="n">fr</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">arr1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">arr2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">pnsr_score</span> <span class="o">=</span> <span class="n">fr</span><span class="o">.</span><span class="n">pnsr</span><span class="p">(</span><span class="n">arr1</span><span class="p">,</span> <span class="n">arr2</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="nb">int</span><span class="p">(</span><span class="n">pnsr_score</span><span class="p">)</span>
-<span class="go">365</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">arr1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">arr2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">105</span><span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">psnr_score</span> <span class="o">=</span> <span class="n">fr</span><span class="o">.</span><span class="n">psnr</span><span class="p">(</span><span class="n">arr1</span><span class="p">,</span> <span class="n">arr2</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">int</span><span class="p">(</span><span class="n">psnr_score</span><span class="p">)</span>
+<span class="go">34</span>
 </pre></div>
 </div>
 </dd></dl>
@@ -336,6 +339,37 @@
 </div>
 </dd></dl>
 
+<dl class="function">
+<dt id="ipfml.iqa.fr.ssim">
+<code class="descclassname">ipfml.iqa.fr.</code><code class="descname">ssim</code><span class="sig-paren">(</span><em>img_true</em>, <em>img_test</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/iqa/fr.html#ssim"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.iqa.fr.ssim" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns the computed Structural Similarity (SSIM) between two images</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>img_true</strong> – Image, numpy array of any dimension</li>
+<li><strong>img_test</strong> – Image, numpy array of any dimension</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Computed SSIM score</p>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Example</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">ipfml.iqa</span> <span class="k">import</span> <span class="n">fr</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">arr1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">arr2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">105</span><span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">ssim_score</span> <span class="o">=</span> <span class="n">fr</span><span class="o">.</span><span class="n">ssim</span><span class="p">(</span><span class="n">arr1</span><span class="p">,</span> <span class="n">arr2</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">int</span><span class="p">(</span><span class="n">ssim_score</span><span class="p">)</span>
+<span class="go">0</span>
+</pre></div>
+</div>
+</dd></dl>
+
 <dl class="function">
 <dt id="ipfml.iqa.fr.vif">
 <code class="descclassname">ipfml.iqa.fr.</code><code class="descname">vif</code><span class="sig-paren">(</span><em>img_true</em>, <em>img_test</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/iqa/fr.html#vif"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.iqa.fr.vif" title="Permalink to this definition">¶</a></dt>

+ 2 - 2
docs/build/html/ipfml/ipfml.metrics.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.metrics &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.metrics &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.processing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.processing &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.processing &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.utils.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.utils &mdash; IPFML v0.2.8 documentation</title>
+  <title>ipfml.utils &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

BIN
docs/build/html/objects.inv


+ 2 - 2
docs/build/html/py-modindex.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Python Module Index &mdash; IPFML v0.2.8 documentation</title>
+  <title>Python Module Index &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -59,7 +59,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

+ 2 - 2
docs/build/html/search.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Search &mdash; IPFML v0.2.8 documentation</title>
+  <title>Search &mdash; IPFML v0.2.9 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.2.8
+                0.2.9
               </div>
             
           

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
docs/build/html/searchindex.js


+ 2 - 2
docs/source/conf.py

@@ -24,9 +24,9 @@ copyright = '2019, Jérôme BUISINE'
 author = 'Jérôme BUISINE'
 
 # The short X.Y version
-version = '0.2.8'
+version = '0.2.9'
 # The full versiabson, including alpha/beta/rc tags
-release = 'v0.2.8'
+release = 'v0.2.9'
 
 
 # -- General configuration ---------------------------------------------------

+ 1 - 1
docs/source/index.rst

@@ -14,7 +14,7 @@ Image Processing For Machine Learning
 What's IPFML ?
 =================
 
-IPFML is a python ackage developed during a thesis project.
+IPFML is a python package developed during a thesis project.
 
 .. toctree::
    :maxdepth: 3

+ 2 - 1
docs/source/ipfml/ipfml.iqa.fr.rst

@@ -12,8 +12,9 @@ ipfml.iqa.fr
       mae
       ms_ssim
       mse
-      pnsr
+      psnr
       rmse
+      ssim
       vif
    
    

+ 39 - 9
ipfml/iqa/fr.py

@@ -8,7 +8,7 @@ from ipfml.exceptions import NumpyShapeComparisonException
 import numpy as np
 
 
-def _prepare_arrays(img_true, img_test):
+def _prepare_arrays(img_true, img_test, p_dtype='float32'):
     """
     Prepare image data
 
@@ -16,8 +16,8 @@ def _prepare_arrays(img_true, img_test):
         NumpyShapeComparisonException: if shape of images are not the same
     """
 
-    img_true = np.asarray(img_true, dtype='float32')
-    img_test = np.asarray(img_test, dtype='float32')
+    img_true = np.asarray(img_true, dtype=p_dtype)
+    img_test = np.asarray(img_test, dtype=p_dtype)
 
     if img_true.shape != img_test.shape:
         raise NumpyShapeComparisonException
@@ -107,7 +107,7 @@ def mae(img_true, img_test):
     return np.mean(np.absolute(img_true - img_test), dtype=np.float64)
 
 
-def pnsr(img_true, img_test):
+def psnr(img_true, img_test):
     """Returns the computed Peak Signal to Noise Ratio (PSNR) between two images
 
     Args:
@@ -120,16 +120,46 @@ def pnsr(img_true, img_test):
     Example:
         >>> from ipfml.iqa import fr
         >>> import numpy as np
-        >>> arr1 = np.arange(10)
-        >>> arr2 = np.arange(5, 15)
-        >>> pnsr_score = fr.pnsr(arr1, arr2)
-        >>> int(pnsr_score)
-        365
+        >>> arr1 = np.arange(100).reshape(10, 10)
+        >>> arr2 = np.arange(5, 105).reshape(10, 10)
+        >>> psnr_score = fr.psnr(arr1, arr2)
+        >>> int(psnr_score)
+        34
     """
 
+    img_true, img_test = _prepare_arrays(img_true, img_test, 'uint8')
+
     return compare_psnr(img_true, img_test)
 
 
+def ssim(img_true, img_test):
+    """Returns the computed Structural Similarity (SSIM) between two images
+
+    Args:
+        img_true: Image, numpy array of any dimension
+        img_test: Image, numpy array of any dimension
+
+    Returns:
+        Computed SSIM score
+
+    Example:
+        >>> from ipfml.iqa import fr
+        >>> import numpy as np
+        >>> arr1 = np.arange(100).reshape(10, 10)
+        >>> arr2 = np.arange(5, 105).reshape(10, 10)
+        >>> ssim_score = fr.ssim(arr1, arr2)
+        >>> int(ssim_score)
+        0
+    """
+
+    img_true, img_test = _prepare_arrays(img_true, img_test)
+
+    if img_true.ndim == 3:
+        return compare_ssim(img_true, img_test, multichannel=True)
+    else:
+        return compare_ssim(img_true, img_test)
+
+
 def ms_ssim(img_true, img_test):
     """
     Implemented later..

+ 1 - 1
setup.py

@@ -37,7 +37,7 @@ class BuildTestCommand(setuptools.command.build_py.build_py):
 
 setup(
     name='ipfml',
-    version='0.2.8',
+    version='0.2.9',
     description='Image Processing For Machine Learning',
     long_description=readme(),
     classifiers=[