Skip to content

Commit

Permalink
Calculate offsets given ground truth masks (#19)
Browse files Browse the repository at this point in the history
* Bump version 

Calculate offsets given ground truth masks

* add dark mode for docs page

* add offset calculation

* add BaseBx method to calculate offsets

* Supports np.floating and tuple, bug fixes. Resize if image_arr & image_sz is passed together to VisBx.

* Revert "Supports np.floating and tuple, bug fixes. Resize if image_arr & image_sz is passed together to VisBx."

This reverts commit 0d8cf47.

* get_gt_offsets() method that can calculate normalized offsets (ground truth should be a `BX_TYPE`)

* test_yolo update to round(4)

* get_gt_offsets() method that can calculate normalized offsets

* get_gt_offsets() fix imports

* add docs and update readme
  • Loading branch information
thatgeeman authored Aug 19, 2023
1 parent 157cb7c commit f1be8e4
Show file tree
Hide file tree
Showing 85 changed files with 5,207 additions and 1,134 deletions.
422 changes: 404 additions & 18 deletions _proc/_docs/anchor.html → _docs/anchor.html

Large diffs are not rendered by default.

417 changes: 315 additions & 102 deletions _proc/_docs/basics.html → _docs/basics.html

Large diffs are not rendered by default.

126 changes: 123 additions & 3 deletions _proc/_docs/excepts.html → _docs/excepts.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="site_libs/quarto-html/quarto-syntax-highlighting-dark.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="site_libs/bootstrap/bootstrap-dark.min.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
Expand Down Expand Up @@ -80,6 +82,9 @@
<span class="navbar-title">pybx</span>
</a>
</div>
<div class="quarto-toggle-container ms-auto">
<a href="" class="quarto-color-scheme-toggle nav-link" onclick="window.quartoToggleColorScheme(); return false;" title="Toggle dark mode"><i class="bi"></i></a>
</div>
<div id="quarto-search" class="" title="Search"></div>
</div> <!-- /container-fluid -->
</nav>
Expand Down Expand Up @@ -175,7 +180,7 @@ <h1 class="title d-none d-lg-block">Exceptions</h1>

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
<hr>
<p><a href="https://github.com/thatgeeman/pybx/blob/master/pybx/excepts.py#L21" target="_blank" style="float:right; font-size:smaller">source</a></p>
<p><a href="https://github.com/thatgeeman/pybx/blob/master/pybx/excepts.py#L22" target="_blank" style="float:right; font-size:smaller">source</a></p>
<section id="nogroundtruthbxs" class="level3">
<h3 class="anchored" data-anchor-id="nogroundtruthbxs">NoGroundTruthBxs</h3>
<p>No Ground Truth boxes found.</p>
Expand Down Expand Up @@ -216,6 +221,121 @@ <h3 class="anchored" data-anchor-id="nointersection">NoIntersection</h3>
}
}
toggleBodyColorPrimary();
const disableStylesheet = (stylesheets) => {
for (let i=0; i < stylesheets.length; i++) {
const stylesheet = stylesheets[i];
stylesheet.rel = 'prefetch';
}
}
const enableStylesheet = (stylesheets) => {
for (let i=0; i < stylesheets.length; i++) {
const stylesheet = stylesheets[i];
stylesheet.rel = 'stylesheet';
}
}
const manageTransitions = (selector, allowTransitions) => {
const els = window.document.querySelectorAll(selector);
for (let i=0; i < els.length; i++) {
const el = els[i];
if (allowTransitions) {
el.classList.remove('notransition');
} else {
el.classList.add('notransition');
}
}
}
const toggleColorMode = (alternate) => {
// Switch the stylesheets
const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
manageTransitions('#quarto-margin-sidebar .nav-link', false);
if (alternate) {
enableStylesheet(alternateStylesheets);
for (const sheetNode of alternateStylesheets) {
if (sheetNode.id === "quarto-bootstrap") {
toggleBodyColorMode(sheetNode);
}
}
} else {
disableStylesheet(alternateStylesheets);
toggleBodyColorPrimary();
}
manageTransitions('#quarto-margin-sidebar .nav-link', true);
// Switch the toggles
const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
for (let i=0; i < toggles.length; i++) {
const toggle = toggles[i];
if (toggle) {
if (alternate) {
toggle.classList.add("alternate");
} else {
toggle.classList.remove("alternate");
}
}
}
// Hack to workaround the fact that safari doesn't
// properly recolor the scrollbar when toggling (#1455)
if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
manageTransitions("body", false);
window.scrollTo(0, 1);
setTimeout(() => {
window.scrollTo(0, 0);
manageTransitions("body", true);
}, 40);
}
}
const isFileUrl = () => {
return window.location.protocol === 'file:';
}
const hasAlternateSentinel = () => {
let styleSentinel = getColorSchemeSentinel();
if (styleSentinel !== null) {
return styleSentinel === "alternate";
} else {
return false;
}
}
const setStyleSentinel = (alternate) => {
const value = alternate ? "alternate" : "default";
if (!isFileUrl()) {
window.localStorage.setItem("quarto-color-scheme", value);
} else {
localAlternateSentinel = value;
}
}
const getColorSchemeSentinel = () => {
if (!isFileUrl()) {
const storageValue = window.localStorage.getItem("quarto-color-scheme");
return storageValue != null ? storageValue : localAlternateSentinel;
} else {
return localAlternateSentinel;
}
}
let localAlternateSentinel = 'alternate';
// Dark / light mode switch
window.quartoToggleColorScheme = () => {
// Read the current dark / light value
let toAlternate = !hasAlternateSentinel();
toggleColorMode(toAlternate);
setStyleSentinel(toAlternate);
};
// Ensure there is a toggle, if there isn't float one in the top right
if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
const a = window.document.createElement('a');
a.classList.add('top-right');
a.classList.add('quarto-color-scheme-toggle');
a.href = "";
a.onclick = function() { try { window.quartoToggleColorScheme(); } catch {} return false; };
const i = window.document.createElement("i");
i.classList.add('bi');
a.appendChild(i);
window.document.body.appendChild(a);
}
// Switch to dark mode if need be
if (hasAlternateSentinel()) {
toggleColorMode(true);
} else {
toggleColorMode(false);
}
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
Expand Down
Loading

0 comments on commit f1be8e4

Please sign in to comment.