Skip to content

Commit

Permalink
RMSE to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclifford1 committed Aug 7, 2024
1 parent 6896505 commit 0a34dea
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 2 deletions.
Binary file modified docs/_build/doctrees/IQM_Vis.metrics.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
41 changes: 41 additions & 0 deletions docs/_build/html/IQM_Vis.metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,47 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="IQM_Vis.metrics.IQMs.RMSE">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">IQM_Vis.metrics.IQMs.</span></span><span class="sig-name descname"><span class="pre">RMSE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">return_image</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/IQM_Vis/metrics/IQMs.html#RMSE"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#IQM_Vis.metrics.IQMs.RMSE" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="simple">
<dt>Root Mean Squared Error between two images. Images must have the same</dt><dd><p>dimensions</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>return_image</strong> (<em>bool</em>) – Whether to return the image (Defaults to False which
will return a scalar value)</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="IQM_Vis.metrics.IQMs.RMSE.__call__">
<span class="sig-name descname"><span class="pre">__call__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">im_ref</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">im_comp</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/IQM_Vis/metrics/IQMs.html#RMSE.__call__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#IQM_Vis.metrics.IQMs.RMSE.__call__" title="Permalink to this definition"></a></dt>
<dd><p>When an instance is called</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>im_ref</strong> (<em>np.array</em>) – Reference image</p></li>
<li><p><strong>im_comp</strong> (<em>np.array</em>) – Comparison image</p></li>
<li><p><strong>**kwargs</strong> – Arbitrary keyword arguments</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>RMSE (scalar if return_image is False, image if</dt><dd><p>return_image is True)</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>score (np.array)</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="IQM_Vis.metrics.IQMs.SSIM">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">IQM_Vis.metrics.IQMs.</span></span><span class="sig-name descname"><span class="pre">SSIM</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">return_image</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/IQM_Vis/metrics/IQMs.html#SSIM"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#IQM_Vis.metrics.IQMs.SSIM" title="Permalink to this definition"></a></dt>
Expand Down
3 changes: 2 additions & 1 deletion docs/_build/html/_modules/IQM_Vis/examples/kodak.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ <h1>Source code for IQM_Vis.examples.kodak</h1><div class="highlight"><pre>
<span class="n">image_list</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>

<span class="n">metrs</span> <span class="o">=</span> <span class="n">IQM_Vis</span><span class="o">.</span><span class="n">metrics</span><span class="o">.</span><span class="n">get_all_metrics</span><span class="p">()</span>
<span class="n">metrs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;1-MS_SSIM&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;1-MS_SSIM&#39;</span> <span class="ow">in</span> <span class="n">metrs</span><span class="p">:</span>
<span class="n">metrs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;1-MS_SSIM&#39;</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">IQM_Vis</span><span class="o">.</span><span class="n">dataset_holder</span><span class="p">(</span><span class="n">image_list</span><span class="p">,</span>
<span class="n">metrs</span><span class="p">,</span>
<span class="c1"># IQM_Vis.metrics.get_all_metric_images()</span>
Expand Down
3 changes: 3 additions & 0 deletions docs/_build/html/_modules/IQM_Vis/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<h1>Source code for IQM_Vis.metrics</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">IQM_Vis.metrics.IQMs</span> <span class="kn">import</span> <span class="p">(</span><span class="n">MAE</span><span class="p">,</span>
<span class="n">MSE</span><span class="p">,</span>
<span class="n">RMSE</span><span class="p">,</span>
<span class="n">SSIM</span><span class="p">,</span>
<span class="n">MS_SSIM</span><span class="p">,</span>
<span class="n">LPIPS</span><span class="p">,</span>
Expand All @@ -109,6 +110,7 @@ <h1>Source code for IQM_Vis.metrics</h1><div class="highlight"><pre>
<span class="s1">&#39;DISTS&#39;</span><span class="p">:</span> <span class="n">DISTS</span><span class="p">(),</span>
<span class="s1">&#39;LPIPS&#39;</span><span class="p">:</span> <span class="n">LPIPS</span><span class="p">(),</span>
<span class="s1">&#39;MAE&#39;</span><span class="p">:</span> <span class="n">MAE</span><span class="p">(),</span>
<span class="s1">&#39;RMSE&#39;</span><span class="p">:</span> <span class="n">RMSE</span><span class="p">(),</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">all_metrics</span></div>

Expand All @@ -124,6 +126,7 @@ <h1>Source code for IQM_Vis.metrics</h1><div class="highlight"><pre>
<span class="s1">&#39;SSIM&#39;</span><span class="p">:</span> <span class="n">SSIM</span><span class="p">(</span><span class="n">return_image</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
<span class="c1"># &#39;MS_SSIM&#39;: MS_SSIM(return_image=True),</span>
<span class="s1">&#39;MAE&#39;</span><span class="p">:</span> <span class="n">MAE</span><span class="p">(</span><span class="n">return_image</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
<span class="s1">&#39;RMSE&#39;</span><span class="p">:</span> <span class="n">RMSE</span><span class="p">(</span><span class="n">return_image</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">all_metrics</span></div>

Expand Down
30 changes: 30 additions & 0 deletions docs/_build/html/_modules/IQM_Vis/metrics/IQMs.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,36 @@ <h1>Source code for IQM_Vis.metrics.IQMs</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">L2</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">L2</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span></div></div>

<div class="viewcode-block" id="RMSE"><a class="viewcode-back" href="../../../IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.RMSE">[docs]</a><span class="k">class</span> <span class="nc">RMSE</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&#39;&#39;&#39;Root Mean Squared Error between two images. Images must have the same</span>
<span class="sd"> dimensions</span>

<span class="sd"> Args:</span>
<span class="sd"> return_image (bool): Whether to return the image (Defaults to False which</span>
<span class="sd"> will return a scalar value)</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">return_image</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">return_image</span> <span class="o">=</span> <span class="n">return_image</span>

<div class="viewcode-block" id="RMSE.__call__"><a class="viewcode-back" href="../../../IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.RMSE.__call__">[docs]</a> <span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">im_ref</span><span class="p">,</span> <span class="n">im_comp</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&#39;&#39;&#39;When an instance is called</span>

<span class="sd"> Args:</span>
<span class="sd"> im_ref (np.array): Reference image</span>
<span class="sd"> im_comp (np.array): Comparison image</span>
<span class="sd"> **kwargs: Arbitrary keyword arguments</span>

<span class="sd"> Returns:</span>
<span class="sd"> score (np.array): RMSE (scalar if return_image is False, image if</span>
<span class="sd"> return_image is True)</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="n">_check_shapes</span><span class="p">(</span><span class="n">im_ref</span><span class="p">,</span> <span class="n">im_comp</span><span class="p">)</span>
<span class="n">L2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">im_ref</span> <span class="o">-</span> <span class="n">im_comp</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">return_image</span><span class="p">:</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">L2</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">L2</span><span class="o">.</span><span class="n">mean</span><span class="p">())</span></div></div>

<div class="viewcode-block" id="SSIM"><a class="viewcode-back" href="../../../IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.SSIM">[docs]</a><span class="k">class</span> <span class="nc">SSIM</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&#39;&#39;&#39;Structural Similarity Index Measure between two images. Images must have</span>
Expand Down
4 changes: 4 additions & 0 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ <h2 id="_">_</h2>
<li><a href="IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.NLPD.__call__">(IQM_Vis.metrics.IQMs.NLPD method)</a>
</li>
<li><a href="IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.one_over_PSNR.__call__">(IQM_Vis.metrics.IQMs.one_over_PSNR method)</a>
</li>
<li><a href="IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.RMSE.__call__">(IQM_Vis.metrics.IQMs.RMSE method)</a>
</li>
<li><a href="IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.SSIM.__call__">(IQM_Vis.metrics.IQMs.SSIM method)</a>
</li>
Expand Down Expand Up @@ -1035,6 +1037,8 @@ <h2 id="R">R</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="IQM_Vis.utils.html#IQM_Vis.utils.image_utils.resize_to_longest_side">resize_to_longest_side() (in module IQM_Vis.utils.image_utils)</a>
</li>
<li><a href="IQM_Vis.metrics.html#IQM_Vis.metrics.IQMs.RMSE">RMSE (class in IQM_Vis.metrics.IQMs)</a>
</li>
<li><a href="IQM_Vis.transformations.html#IQM_Vis.transformations.transforms.rotation">rotation() (in module IQM_Vis.transformations.transforms)</a>
</li>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 0a34dea

Please sign in to comment.