diff --git a/_proc/.gitignore b/_proc/.gitignore index 075b254..1a3319a 100644 --- a/_proc/.gitignore +++ b/_proc/.gitignore @@ -1 +1 @@ -/.quarto/ +# /.quarto/ diff --git a/_proc/.quarto/idx/00_anchor.ipynb.json b/_proc/.quarto/idx/00_anchor.ipynb.json new file mode 100644 index 0000000..e914269 --- /dev/null +++ b/_proc/.quarto/idx/00_anchor.ipynb.json @@ -0,0 +1 @@ +{"title":"Generate anchor boxes","markdown":{"yaml":{"description":"Methods to generate anchor boxes of different aspect ratios.","output-file":"anchor.html","title":"Generate anchor boxes"},"headingText":"Ground truth anchor boxes","containsRefs":false,"markdown":"\n\n\n\n\n\nTo generate anchor boxes, we need three basic information:\n\n- Input image size, `image_sz`: To position our anchor boxes within the maximum \ncoordinates (`width`, `height`) of the image.\n- Feature map size, `feature_sz`: Feature map is the size (`width`, `height`) \nof the output of a convolutional operation. A $10\\times10$ feature map would mean \n$10\\times10$ local receptive field locations can be traced back into the \ninput image. These 100 receptive field locations ($10\\times10=100$) in the input image \nwould act as our initial anchor box candidates.\n\n![](https://ars.els-cdn.com/content/image/1-s2.0-S0925231217314169-gr4.jpg)\n\n- Aspect ratio of anchor boxes, `asp_ratio`: To generate anchor boxes with \ndifferent `width` to `height` ratio (default `asp_ratio=1`).\n\nUsually multiple anchor boxes with different `feature_sz` and `asp_ratio` are \nneeded. This requirement arises in the case of multiscale object detection.\n\nFor multiscale object detection, feature maps from different convolution \noperations of the network are used to trace back into the input image, to \ngenerate anchor boxes. \nThe [`bxs`](https://thatgeeman.github.io/pybx/anchor.html#bxs) method of `pybx` provides this possibility.\n\nAll methods work with asymetric `image_sz` (and or `feature_szs` as well):\n\nGround truth boxes are anchor boxes with maximum IOU with the true annotations.\n\nLoad actual annotations.\n\nConvert to MultiBx for convenience:\n\nGenerate anchor boxes for object detection task, given that we know: \n\n```py\nimage_sz = (256, 256) # to know the upper bounds of candidate bounding boxes\nfeature_sz = [20, 10, 8, 3]\nasp_ratio = [1, 0.5, 0.3]\n```\n\nStore coords as multibx for convenience.\n\nCan use the true annotations and anchor boxes to calulate the IOU.\n\nThe question: for each true label in the provided true annotations, what are the possible ground truth anchor boxes?\n\nImprove the loop to return only those with good IOU:\n\nNot very far from the original annotations. These scales and aspect ratios can also be read from the label. \nThe finer the anchor boxes, the better the starting positions (ground truth anchor boxes).\n\nIf anchor box labels are passed, they can be preserved instead of overwriting with ground truth labels.\n\nTrue annots can also be a list containing the label as the last item.\n\nMethod to also return just the max IOU ground truth boxes.\n\nCan also use methods for the box to calculate properties or convert to different box formats.\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"anchor.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","description":"Methods to generate anchor boxes of different aspect ratios.","title":"Generate anchor boxes"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/01_basics.ipynb.json b/_proc/.quarto/idx/01_basics.ipynb.json new file mode 100644 index 0000000..351235b --- /dev/null +++ b/_proc/.quarto/idx/01_basics.ipynb.json @@ -0,0 +1 @@ +{"title":"Basic objects","markdown":{"yaml":{"description":"Basic object types and methods utilized in `pybx`","output-file":"basics.html","title":"Basic objects"},"headingText":"[`get_bx`](https://thatgeeman.github.io/pybx/basics.html#get_bx)","containsRefs":false,"markdown":"\n\n\n\n\n\nAnchor box coordinates of type `list`/`dict`/`json`/`array` can be converted \nto a [`Bx`](https://thatgeeman.github.io/pybx/basics.html#bx) instance. Once wrapped as a [`Bx`](https://thatgeeman.github.io/pybx/basics.html#bx) instance, some interesting properties can\nbe calculated from the coordinates. \n\nInitializing an empty [`Bx`](https://thatgeeman.github.io/pybx/basics.html#bx) class. It does a whole lot of things!\n\nGenerate random coordinates for one anchor boxes.\n\nIf a single list is passed, [`Bx`](https://thatgeeman.github.io/pybx/basics.html#bx) will make it a list of list.\n\nSo the correct way to do it would be to pass a list of list.\n\nTo get normalized coordinates wrt to the image dimensions.\n\n[`Bx`](https://thatgeeman.github.io/pybx/basics.html#bx) is inherited by all other types in `pybx`: [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx), [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx), `ListBx`, `JsonBx`, exposing the same properties.\n\n[`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) works with other types of coordinates too. \nIt accepts the coordinates and label for one anchor box in a `list` or `ndarray` \nformat.\n\nWorks with arrays and lists:\n\nCalling the `values` attribute returns the labels along with the coordinates.\n\n[`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) also exposes a method to calculate the Intersection Over Union (IOU):\n\n[`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) is also pseudo-iterable (calling an iterator returns `self` itself and not the coordinates or labels).\n\nWorking with multiple bounding boxes and annotaions is usually done with the help\nof [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx). [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) allows iteration.\n\nGenerate random coordinates:\n\nAll annotations are stored as a [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) in a container called [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx)\n\nEach index reveals the stored coordinate as a [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx)\n\nThey can also be iterated:\n\nOr using list comprehension, properties of individual boxes can be extracted\n\nExtending [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) to also accept (`json`, `dict`) formatted coordinates and labels.\n\nAlso accepts keys (for the dict) as a list, otherwise uses `voc_keys`.\n\nMaking [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) work with lists with more than 4 items. It is a common practice\nto have the class label along with the coordinates. This classmethod is useful in such \nsituations\n\nInserting classmethod to process lists and dicts in [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx).\n\nHow the class method works:\n\nChecking if it works with ndarrays\n\nAllowing [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) to process a single `dict` and `list` directly.\n\nRemember that [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) can only have one box coordinate and label at a time.\n\nWhat does [`make_single_iterable`](https://thatgeeman.github.io/pybx/ops.html#make_single_iterable) do? It converts a single list or dict of \ncoordinates into an iterable list that can be used by [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx).\n\nThe class method makes it easier to directly call [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) without making the coordinates a list of list.\n\n\nWhen in doubt, use [`get_bx`](https://thatgeeman.github.io/pybx/basics.html#get_bx).\n\n[`get_bx`](https://thatgeeman.github.io/pybx/basics.html#get_bx) runs a bunch of if-else statements to call the right module when in doubt.\n\nEnabling stacking of different boxes.\n\nInternally this is what is done to stack them:\n\nAdding a [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) to a [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) makes the new set of coordinates a [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx), so a [`BxViolation`](https://thatgeeman.github.io/pybx/excepts.html#bxviolation) warning is issued\nif this was not intended. \n\nTo avoid the [`BxViolation`](https://thatgeeman.github.io/pybx/excepts.html#bxviolation), use the method [`stack_bxs`](https://thatgeeman.github.io/pybx/basics.html#stack_bxs).\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"basics.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","description":"Basic object types and methods utilized in `pybx`","title":"Basic objects"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/02_utils.ipynb.json b/_proc/.quarto/idx/02_utils.ipynb.json new file mode 100644 index 0000000..fab6863 --- /dev/null +++ b/_proc/.quarto/idx/02_utils.ipynb.json @@ -0,0 +1 @@ +{"title":"Utilities","markdown":{"yaml":{"description":"Utility functions used in `pybx` to calculate anchor boxes, among others.","output-file":"utils.html","title":"Utilities"},"containsRefs":false,"markdown":"\n\n\n\n\n\nGenerate (`x_min`, `y_min`) corners.\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"utils.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","description":"Utility functions used in `pybx` to calculate anchor boxes, among others.","title":"Utilities"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/03_ops.ipynb.json b/_proc/.quarto/idx/03_ops.ipynb.json new file mode 100644 index 0000000..13e91d3 --- /dev/null +++ b/_proc/.quarto/idx/03_ops.ipynb.json @@ -0,0 +1 @@ +{"title":"Operations","markdown":{"yaml":{"description":"Operations with bounding box coordinates.","output-file":"ops.html","title":"Operations"},"containsRefs":false,"markdown":"\n\n\n\n\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"ops.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","description":"Operations with bounding box coordinates.","title":"Operations"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/04_sample.ipynb.json b/_proc/.quarto/idx/04_sample.ipynb.json new file mode 100644 index 0000000..8e92156 --- /dev/null +++ b/_proc/.quarto/idx/04_sample.ipynb.json @@ -0,0 +1 @@ +{"title":"Samples","markdown":{"yaml":{"description":"Methods to generate sample images (random noise) and load an image from disk.","output-file":"sample.html","title":"Samples"},"containsRefs":false,"markdown":"\n\n\n\n\n\nRescale the annotations to match the new image size. Can individually process dicts.\n\nProcesses lists of dicts\n\nAlso works with lists with labels.\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"sample.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","description":"Methods to generate sample images (random noise) and load an image from disk.","title":"Samples"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/05_vis.ipynb.json b/_proc/.quarto/idx/05_vis.ipynb.json new file mode 100644 index 0000000..b976168 --- /dev/null +++ b/_proc/.quarto/idx/05_vis.ipynb.json @@ -0,0 +1 @@ +{"title":"Visualizations","markdown":{"yaml":{"description":"The `vis` module of `pybx` can be used to visualize these \"stacks\"","output-file":"vis.html","title":"Visualizations"},"headingText":"Loading from disk","containsRefs":false,"markdown":"\n\n\n\n\n\nLoad a sample image from the data directory `../data/image.jpg` and resize to `(200, 200)`. Original image size is `(256, 256)`.\n\n`im` is the image of a clock and a frame, \n`ann` are the annotations for the image in json format, \n`lgt` are logits (activations from a layer) which can be displayed on top of the image, \n`clr` is a dict representing the colors to use for the different annotation keys.\n\nStore the annotations as a [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) object.\n\nDrawing random box by passing coordinates as a list.\n\nDrawing random box by passing coordinates as a list along with label.\n\nTo display the calculated anchor boxes or any other type of bounding\nboxes, `pybx` offers the `vis.VisBx` class.\nFirst, `vis.VisBx` initializes all the params for the image\nand loads its annotations (if available).\nUpon calling the `show()` method on the instantiated \n[`VisBx`](https://thatgeeman.github.io/pybx/vis.html#visbx) object with our \npredicted annotations or anchor boxes, everything \ngets displayed.\n\n### Display image array (default behaviour)\n\nTo display an image array (shape of `W, H, C`) directly, instead of \nloading from disk, pass an `ndarray`\nto the `image_arr` argument. If available, also provide the\n`annots` in any supported format. Displaying calculated anchors with a random image:\n\n### Load image and show annots\n\nDisplaying calculated anchors with a sample image. The original annotations are also rescaled to match the `image_sz`.\n\n### Customize colors\n\nTo customize the box colors, pass a dict `color` with the annotation name as key and color as value. In the example below an anchor box color is changed to red using its label `a_3x3_1.0_3` along with the annotations provided read from file.\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"vis.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","description":"The `vis` module of `pybx` can be used to visualize these \"stacks\"","title":"Visualizations"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/06_excepts.ipynb.json b/_proc/.quarto/idx/06_excepts.ipynb.json new file mode 100644 index 0000000..da2156e --- /dev/null +++ b/_proc/.quarto/idx/06_excepts.ipynb.json @@ -0,0 +1 @@ +{"title":"Exceptions","markdown":{"yaml":{"output-file":"excepts.html","title":"Exceptions"},"containsRefs":false,"markdown":"\n\n\n\n\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"excepts.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","title":"Exceptions"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/idx/index.ipynb.json b/_proc/.quarto/idx/index.ipynb.json new file mode 100644 index 0000000..19dd5c7 --- /dev/null +++ b/_proc/.quarto/idx/index.ipynb.json @@ -0,0 +1 @@ +{"title":"PyBx","markdown":{"yaml":{"output-file":"index.html","title":"PyBx"},"headingText":"Installation","containsRefs":false,"markdown":"\n\n\n\n\n\n```shell\npip install pybx\n```\n\n### Usage\n\nTo calculate the anchor boxes for a single feature size and \naspect ratio, given the image size: \n\n100 anchor boxes of `asp_ratio` 0.5 is generated along with [unique labels](../data/README.md):\n\nThe anchor box labels are especially useful, since they are pretty descriptive:\n\nTo calculate anchor boxes for **multiple** feature sizes and \naspect ratios, we use `anchor.bxs` instead:\n\nAll anchor boxes are returned as `ndarrays` of shape `(N,4)` where N\nis the number of boxes. \n\nThe box labels are even more important now, since they help you uniquely identify \nto which feature map size or aspect ratios they belong to.\n\n#### [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) methods\nBox coordinates (with/without labels) in any format \n(usually `ndarray`, `list`, `json`, `dict`) \ncan be instantialized as a [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx), exposing many useful \nmethods and attributes of [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx). \nFor example to calculate the area of each box iteratively:\n\nEach annotation in the [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) object `boxes` is also a [`BaseBx`](https://thatgeeman.github.io/pybx/basics.html#basebx) \nwith its own set of methods and properties. \n\n[`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) objects can also be \"added\" which stacks \nthem vertically to create a new [`MultiBx`](https://thatgeeman.github.io/pybx/basics.html#multibx) object:\n\n# Use ground truth boxes for model training\n\nCalculate candidate anchor boxes for many aspect ratios and scales.\n\nWrap using pybx methods. This step is not necessary but convenient.\n\nThe following function returns two positive ground truth anchors with largest IOU for each class in the label bounding boxes passed.\n\nMore exploratory stuff in the [walkthrough notebook](../examples/pybx_walkthrough_0.4.ipynb)!\n"},"formats":{"html":{"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":true,"cache":null,"freeze":false,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":false,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"engine":"jupyter"},"render":{"keep-tex":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[]},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","css":["styles.css"],"toc":true,"output-file":"index.html"},"language":{},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.2.184","theme":"cosmo","title":"PyBx"},"extensions":{"book":{"multiFile":true}}}}} \ No newline at end of file diff --git a/_proc/.quarto/xref/1890ab05 b/_proc/.quarto/xref/1890ab05 new file mode 100644 index 0000000..581d30f --- /dev/null +++ b/_proc/.quarto/xref/1890ab05 @@ -0,0 +1 @@ +{"entries":[],"headings":["loading-from-disk","draw","draw_boxes","draw_rectangle","draw_text","get_extents","get_color","draw_outline","visbx","display-image-array-default-behaviour","load-image-and-show-annots","customize-colors"]} \ No newline at end of file diff --git a/_proc/.quarto/xref/2778602a b/_proc/.quarto/xref/2778602a new file mode 100644 index 0000000..8865e4d --- /dev/null +++ b/_proc/.quarto/xref/2778602a @@ -0,0 +1 @@ +{"headings":["update_keys","intersection_box","named_idx","make_single_iterable","get_op","noop","mul","sub","add"],"entries":[]} \ No newline at end of file diff --git a/_proc/.quarto/xref/443f8f37 b/_proc/.quarto/xref/443f8f37 new file mode 100644 index 0000000..c28d33b --- /dev/null +++ b/_proc/.quarto/xref/443f8f37 @@ -0,0 +1 @@ +{"entries":[],"headings":["get_given_array","get_example"]} \ No newline at end of file diff --git a/_proc/.quarto/xref/55fc4679 b/_proc/.quarto/xref/55fc4679 new file mode 100644 index 0000000..0999876 --- /dev/null +++ b/_proc/.quarto/xref/55fc4679 @@ -0,0 +1 @@ +{"headings":["installation","usage","multibx-methods","use-ground-truth-boxes-for-model-training"],"entries":[]} \ No newline at end of file diff --git a/_proc/.quarto/xref/9a679b15 b/_proc/.quarto/xref/9a679b15 new file mode 100644 index 0000000..45b71e2 --- /dev/null +++ b/_proc/.quarto/xref/9a679b15 @@ -0,0 +1 @@ +{"entries":[],"headings":["validate_boxes","get_edges","as_tuple","reassign_label"]} \ No newline at end of file diff --git a/_proc/.quarto/xref/INDEX b/_proc/.quarto/xref/INDEX new file mode 100644 index 0000000..b421971 --- /dev/null +++ b/_proc/.quarto/xref/INDEX @@ -0,0 +1,26 @@ +{ + "00_anchor.ipynb": { + "anchor.html": "c412200b" + }, + "01_basics.ipynb": { + "basics.html": "fb9f013e" + }, + "02_utils.ipynb": { + "utils.html": "9a679b15" + }, + "03_ops.ipynb": { + "ops.html": "2778602a" + }, + "04_sample.ipynb": { + "sample.html": "443f8f37" + }, + "05_vis.ipynb": { + "vis.html": "1890ab05" + }, + "06_excepts.ipynb": { + "excepts.html": "ec560d60" + }, + "index.ipynb": { + "index.html": "55fc4679" + } +} \ No newline at end of file diff --git a/_proc/.quarto/xref/c412200b b/_proc/.quarto/xref/c412200b new file mode 100644 index 0000000..a927f9f --- /dev/null +++ b/_proc/.quarto/xref/c412200b @@ -0,0 +1 @@ +{"entries":[],"headings":["bx","bxs","ground-truth-anchor-boxes","get_gt_thresh_iou","get_gt_max_iou"]} \ No newline at end of file diff --git a/_proc/.quarto/xref/ec560d60 b/_proc/.quarto/xref/ec560d60 new file mode 100644 index 0000000..607ea3e --- /dev/null +++ b/_proc/.quarto/xref/ec560d60 @@ -0,0 +1 @@ +{"entries":[],"headings":["nogroundtruthbxs","bxviolation","nointersection"]} \ No newline at end of file diff --git a/_proc/.quarto/xref/fb9f013e b/_proc/.quarto/xref/fb9f013e new file mode 100644 index 0000000..1abd9f6 --- /dev/null +++ b/_proc/.quarto/xref/fb9f013e @@ -0,0 +1 @@ +{"headings":["bx","basebx","basebx.iou","multibx","jbx","lbx","mbx","multibx.multibox","bbx","basebx.basebx","get_bx","get_bx-1","add_bxs","stack_bxs","stack_bxs_inplace"],"entries":[]} \ No newline at end of file diff --git a/_proc/_docs/excepts.html b/_proc/_docs/excepts.html index 6488dda..a98af93 100644 --- a/_proc/_docs/excepts.html +++ b/_proc/_docs/excepts.html @@ -100,7 +100,7 @@

Exceptions