Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinpape committed Dec 21, 2024
1 parent b13c817 commit 8414d2c
Show file tree
Hide file tree
Showing 20 changed files with 8,871 additions and 7,623 deletions.
179 changes: 130 additions & 49 deletions micro_sam.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion micro_sam/__version__.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1 class="modulename">

<label class="view-source-button" for="mod-__version__-view-source"><span>View Source</span></label>

<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos">1</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;1.1.0&quot;</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos">1</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;1.2.0&quot;</span>
</span></pre></div>


Expand Down
10 changes: 5 additions & 5 deletions micro_sam/_vendored.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h1 class="modulename">
</span><span id="L-29"><a href="#L-29"><span class="linenos"> 29</span></a>
</span><span id="L-30"><a href="#L-30"><span class="linenos"> 30</span></a>
</span><span id="L-31"><a href="#L-31"><span class="linenos"> 31</span></a><span class="k">def</span> <span class="nf">batched_mask_to_box</span><span class="p">(</span><span class="n">masks</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">Tensor</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">torch</span><span class="o">.</span><span class="n">Tensor</span><span class="p">:</span>
</span><span id="L-32"><a href="#L-32"><span class="linenos"> 32</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Calculates boxes in XYXY format around masks. Return [0,0,0,0] for an empty mask.</span>
</span><span id="L-32"><a href="#L-32"><span class="linenos"> 32</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Calculates boxes in XYXY format around masks. Return [0, 0, 0, 0] for an empty mask.</span>
</span><span id="L-33"><a href="#L-33"><span class="linenos"> 33</span></a>
</span><span id="L-34"><a href="#L-34"><span class="linenos"> 34</span></a><span class="sd"> For input shape C1xC2x...xHxW, the output shape is C1xC2x...x4.</span>
</span><span id="L-35"><a href="#L-35"><span class="linenos"> 35</span></a>
Expand All @@ -105,7 +105,7 @@ <h1 class="modulename">
</span><span id="L-38"><a href="#L-38"><span class="linenos"> 38</span></a><span class="sd"> It further ensures that inputs are boolean tensors, otherwise the function yields wrong results.</span>
</span><span id="L-39"><a href="#L-39"><span class="linenos"> 39</span></a><span class="sd"> See https://github.com/facebookresearch/segment-anything/issues/552 for details.</span>
</span><span id="L-40"><a href="#L-40"><span class="linenos"> 40</span></a><span class="sd"> &quot;&quot;&quot;</span>
</span><span id="L-41"><a href="#L-41"><span class="linenos"> 41</span></a> <span class="k">assert</span> <span class="n">masks</span><span class="o">.</span><span class="n">dtype</span> <span class="o">==</span> <span class="n">torch</span><span class="o">.</span><span class="n">bool</span>
</span><span id="L-41"><a href="#L-41"><span class="linenos"> 41</span></a> <span class="k">assert</span> <span class="n">masks</span><span class="o">.</span><span class="n">dtype</span> <span class="o">==</span> <span class="n">torch</span><span class="o">.</span><span class="n">bool</span><span class="p">,</span> <span class="n">masks</span><span class="o">.</span><span class="n">dtype</span>
</span><span id="L-42"><a href="#L-42"><span class="linenos"> 42</span></a>
</span><span id="L-43"><a href="#L-43"><span class="linenos"> 43</span></a> <span class="c1"># torch.max below raises an error on empty inputs, just skip in this case</span>
</span><span id="L-44"><a href="#L-44"><span class="linenos"> 44</span></a> <span class="k">if</span> <span class="n">torch</span><span class="o">.</span><span class="n">numel</span><span class="p">(</span><span class="n">masks</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
Expand Down Expand Up @@ -233,7 +233,7 @@ <h1 class="modulename">
</div>
<a class="headerlink" href="#batched_mask_to_box"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="batched_mask_to_box-32"><a href="#batched_mask_to_box-32"><span class="linenos">32</span></a><span class="k">def</span> <span class="nf">batched_mask_to_box</span><span class="p">(</span><span class="n">masks</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">Tensor</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">torch</span><span class="o">.</span><span class="n">Tensor</span><span class="p">:</span>
</span><span id="batched_mask_to_box-33"><a href="#batched_mask_to_box-33"><span class="linenos">33</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Calculates boxes in XYXY format around masks. Return [0,0,0,0] for an empty mask.</span>
</span><span id="batched_mask_to_box-33"><a href="#batched_mask_to_box-33"><span class="linenos">33</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Calculates boxes in XYXY format around masks. Return [0, 0, 0, 0] for an empty mask.</span>
</span><span id="batched_mask_to_box-34"><a href="#batched_mask_to_box-34"><span class="linenos">34</span></a>
</span><span id="batched_mask_to_box-35"><a href="#batched_mask_to_box-35"><span class="linenos">35</span></a><span class="sd"> For input shape C1xC2x...xHxW, the output shape is C1xC2x...x4.</span>
</span><span id="batched_mask_to_box-36"><a href="#batched_mask_to_box-36"><span class="linenos">36</span></a>
Expand All @@ -242,7 +242,7 @@ <h1 class="modulename">
</span><span id="batched_mask_to_box-39"><a href="#batched_mask_to_box-39"><span class="linenos">39</span></a><span class="sd"> It further ensures that inputs are boolean tensors, otherwise the function yields wrong results.</span>
</span><span id="batched_mask_to_box-40"><a href="#batched_mask_to_box-40"><span class="linenos">40</span></a><span class="sd"> See https://github.com/facebookresearch/segment-anything/issues/552 for details.</span>
</span><span id="batched_mask_to_box-41"><a href="#batched_mask_to_box-41"><span class="linenos">41</span></a><span class="sd"> &quot;&quot;&quot;</span>
</span><span id="batched_mask_to_box-42"><a href="#batched_mask_to_box-42"><span class="linenos">42</span></a> <span class="k">assert</span> <span class="n">masks</span><span class="o">.</span><span class="n">dtype</span> <span class="o">==</span> <span class="n">torch</span><span class="o">.</span><span class="n">bool</span>
</span><span id="batched_mask_to_box-42"><a href="#batched_mask_to_box-42"><span class="linenos">42</span></a> <span class="k">assert</span> <span class="n">masks</span><span class="o">.</span><span class="n">dtype</span> <span class="o">==</span> <span class="n">torch</span><span class="o">.</span><span class="n">bool</span><span class="p">,</span> <span class="n">masks</span><span class="o">.</span><span class="n">dtype</span>
</span><span id="batched_mask_to_box-43"><a href="#batched_mask_to_box-43"><span class="linenos">43</span></a>
</span><span id="batched_mask_to_box-44"><a href="#batched_mask_to_box-44"><span class="linenos">44</span></a> <span class="c1"># torch.max below raises an error on empty inputs, just skip in this case</span>
</span><span id="batched_mask_to_box-45"><a href="#batched_mask_to_box-45"><span class="linenos">45</span></a> <span class="k">if</span> <span class="n">torch</span><span class="o">.</span><span class="n">numel</span><span class="p">(</span><span class="n">masks</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
Expand Down Expand Up @@ -288,7 +288,7 @@ <h1 class="modulename">
</span></pre></div>


<div class="docstring"><p>Calculates boxes in XYXY format around masks. Return [0,0,0,0] for an empty mask.</p>
<div class="docstring"><p>Calculates boxes in XYXY format around masks. Return [0, 0, 0, 0] for an empty mask.</p>

<p>For input shape C1xC2x...xHxW, the output shape is C1xC2x...x4.</p>

Expand Down
Loading

0 comments on commit 8414d2c

Please sign in to comment.