Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 29, 2024
1 parent e61e31f commit 792ecd7
Show file tree
Hide file tree
Showing 13 changed files with 882 additions and 198 deletions.
3 changes: 2 additions & 1 deletion develop/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ <h1>All modules for which code is available</h1>
<li><a href="openvino_xai/explainer/explainer.html">openvino_xai.explainer.explainer</a></li>
<li><a href="openvino_xai/explainer/explanation.html">openvino_xai.explainer.explanation</a></li>
<li><a href="openvino_xai/explainer/visualizer.html">openvino_xai.explainer.visualizer</a></li>
<li><a href="openvino_xai/methods/black_box/aise.html">openvino_xai.methods.black_box.aise</a></li>
<li><a href="openvino_xai/methods/black_box/aise/classification.html">openvino_xai.methods.black_box.aise.classification</a></li>
<li><a href="openvino_xai/methods/black_box/aise/detection.html">openvino_xai.methods.black_box.aise.detection</a></li>
<li><a href="openvino_xai/methods/black_box/rise.html">openvino_xai.methods.black_box.rise</a></li>
<li><a href="openvino_xai/methods/white_box/activation_map.html">openvino_xai.methods.white_box.activation_map</a></li>
<li><a href="openvino_xai/methods/white_box/base.html">openvino_xai.methods.white_box.base</a></li>
Expand Down
1 change: 1 addition & 0 deletions develop/_modules/openvino_xai/explainer/explainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ <h1>Source code for openvino_xai.explainer.explainer</h1><div class="highlight">
<span class="n">saliency_map</span><span class="o">=</span><span class="n">saliency_map</span><span class="p">,</span>
<span class="n">targets</span><span class="o">=</span><span class="n">targets</span><span class="p">,</span>
<span class="n">label_names</span><span class="o">=</span><span class="n">label_names</span><span class="p">,</span>
<span class="n">metadata</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">metadata</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_visualize</span><span class="p">(</span>
<span class="n">original_input_image</span><span class="p">,</span>
Expand Down
5 changes: 4 additions & 1 deletion develop/_modules/openvino_xai/explainer/explanation.html
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,13 @@ <h1>Source code for openvino_xai.explainer.explanation</h1><div class="highlight
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">enum</span> <span class="kn">import</span> <span class="n">Enum</span>
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span>

<span class="kn">import</span> <span class="nn">cv2</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="kn">from</span> <span class="nn">openvino_xai.common.parameters</span> <span class="kn">import</span> <span class="n">Task</span>
<span class="kn">from</span> <span class="nn">openvino_xai.common.utils</span> <span class="kn">import</span> <span class="n">logger</span>
<span class="kn">from</span> <span class="nn">openvino_xai.explainer.utils</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">convert_targets_to_numpy</span><span class="p">,</span>
Expand Down Expand Up @@ -435,6 +436,7 @@ <h1>Source code for openvino_xai.explainer.explanation</h1><div class="highlight
<span class="n">saliency_map</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span> <span class="o">|</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">int</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">],</span>
<span class="n">targets</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span> <span class="o">|</span> <span class="n">List</span><span class="p">[</span><span class="nb">int</span> <span class="o">|</span> <span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="nb">int</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">label_names</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">metadata</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="n">Task</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">):</span>
<span class="n">targets</span> <span class="o">=</span> <span class="n">convert_targets_to_numpy</span><span class="p">(</span><span class="n">targets</span><span class="p">)</span>

Expand All @@ -457,6 +459,7 @@ <h1>Source code for openvino_xai.explainer.explanation</h1><div class="highlight
<span class="bp">self</span><span class="o">.</span><span class="n">_saliency_map</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_select_target_saliency_maps</span><span class="p">(</span><span class="n">targets</span><span class="p">,</span> <span class="n">label_names</span><span class="p">)</span>

<span class="bp">self</span><span class="o">.</span><span class="n">label_names</span> <span class="o">=</span> <span class="n">label_names</span>
<span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">saliency_map</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">int</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">]:</span>
Expand Down
Loading

0 comments on commit 792ecd7

Please sign in to comment.