diff --git a/docs/rst-code/brails.exceptions.html b/docs/rst-code/brails.exceptions.html new file mode 100644 index 0000000..972a542 --- /dev/null +++ b/docs/rst-code/brails.exceptions.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.exceptions module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.exceptions module

+

This module defines the Brails exceptions.

+
+
+exception brails.exceptions.BrailsError(message: str = 'An error occurred in the BRAILS application')
+

Bases: Exception

+

Custom exception for specific error cases in BRAILS.

+
+ +
+
+exception brails.exceptions.NotFoundError(type_of_thing: str, name: str, where: str | None = None, append: str | None = None)
+

Bases: BrailsError

+

Exception raised when a required entity is not found.

+

This exception should be used for missing elements like classes, keys, or +parameters.

+

Note: For missing files, use the built-in FileNotFoundError instead.

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.exceptions.rst b/docs/rst-code/brails.exceptions.rst new file mode 100644 index 0000000..b06b550 --- /dev/null +++ b/docs/rst-code/brails.exceptions.rst @@ -0,0 +1,7 @@ +brails.exceptions module +======================== + +.. automodule:: brails.exceptions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.filter.html b/docs/rst-code/brails.filters.filter.html new file mode 100644 index 0000000..89a034d --- /dev/null +++ b/docs/rst-code/brails.filters.filter.html @@ -0,0 +1,167 @@ + + + + + + + + + brails.filters.filter module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.filter module

+

This module defines abstract filter class.

+
+
+class brails.filters.filter.Filter(input_data: dict)
+

Bases: ABC

+

Abstract base class for filtering an ImageSet.

+
+
Methods:
+
filter(images, dir_path): Filters the ImageSet based on specific

criteria.

+
+
+
+
+
+
+abstract filter(images: ImageSet, dir_path: str) ImageSet
+

Abstract class that must be implemented by subclasses.

+

This method will be used by the caller to obtain a filtered ImageSet +and save the output in a specified directory.

+
+
Args:

images (ImageSet): The ImageSet to filter. +dir_path (str): Path to the output directory for filtered images.

+
+
Returns:

ImageSet: The filtered set of images.

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.filter.rst b/docs/rst-code/brails.filters.filter.rst new file mode 100644 index 0000000..56fcb86 --- /dev/null +++ b/docs/rst-code/brails.filters.filter.rst @@ -0,0 +1,7 @@ +brails.filters.filter module +============================ + +.. automodule:: brails.filters.filter + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB.html b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB.html new file mode 100644 index 0000000..4c61668 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB.rst b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB.rst new file mode 100644 index 0000000..62f2a22 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.config.GroundingDINO\_SwinB module +=========================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC.html b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC.html new file mode 100644 index 0000000..c130b2f --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC.rst b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC.rst new file mode 100644 index 0000000..42b2ea2 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.config.GroundingDINO\_SwinT\_OGC module +================================================================================ + +.. automodule:: brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.config.html b/docs/rst-code/brails.filters.house_view.groundingdino.config.html new file mode 100644 index 0000000..ffdfbff --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.config.html @@ -0,0 +1,146 @@ + + + + + + + brails.filters.house_view.groundingdino.config package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.config.rst b/docs/rst-code/brails.filters.house_view.groundingdino.config.rst new file mode 100644 index 0000000..885f63b --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.config.rst @@ -0,0 +1,16 @@ +brails.filters.house\_view.groundingdino.config package +======================================================= + +.. automodule:: brails.filters.house_view.groundingdino.config + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.config.GroundingDINO_SwinB + brails.filters.house_view.groundingdino.config.GroundingDINO_SwinT_OGC diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.datasets.html b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.html new file mode 100644 index 0000000..12074ed --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.html @@ -0,0 +1,163 @@ + + + + + + + brails.filters.house_view.groundingdino.datasets package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.datasets.rst b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.rst new file mode 100644 index 0000000..503c073 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.rst @@ -0,0 +1,15 @@ +brails.filters.house\_view.groundingdino.datasets package +========================================================= + +.. automodule:: brails.filters.house_view.groundingdino.datasets + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.datasets.transforms diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.datasets.transforms.html b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.transforms.html new file mode 100644 index 0000000..66ffe14 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.transforms.html @@ -0,0 +1,233 @@ + + + + + + + brails.filters.house_view.groundingdino.datasets.transforms module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.datasets.transforms module

+

Transforms and data augmentation for both image + bbox.

+
+
+class brails.filters.house_view.groundingdino.datasets.transforms.CenterCrop(size)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.Compose(transforms)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.Normalize(mean, std)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomCrop(size)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomErasing(*args, **kwargs)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomHorizontalFlip(p=0.5)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomPad(max_pad)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomResize(sizes, max_size=None)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomSelect(transforms1, transforms2, p=0.5)
+

Bases: object

+

Randomly selects between transforms1 and transforms2, +with probability p for transforms1 and (1 - p) for transforms2

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.RandomSizeCrop(min_size: int, max_size: int, respect_boxes: bool = False)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.ResizeDebug(size)
+

Bases: object

+
+ +
+
+class brails.filters.house_view.groundingdino.datasets.transforms.ToTensor
+

Bases: object

+
+ +
+
+brails.filters.house_view.groundingdino.datasets.transforms.crop(image, target, region)
+
+ +
+
+brails.filters.house_view.groundingdino.datasets.transforms.hflip(image, target)
+
+ +
+
+brails.filters.house_view.groundingdino.datasets.transforms.pad(image, target, padding)
+
+ +
+
+brails.filters.house_view.groundingdino.datasets.transforms.resize(image, target, size, max_size=None)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.datasets.transforms.rst b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.transforms.rst new file mode 100644 index 0000000..e42cc47 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.datasets.transforms.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.datasets.transforms module +=================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.datasets.transforms + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.html b/docs/rst-code/brails.filters.house_view.groundingdino.html new file mode 100644 index 0000000..93bb7ed --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.html @@ -0,0 +1,272 @@ + + + + + + + brails.filters.house_view.groundingdino package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino package

+
+

Subpackages

+
+ +
+
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone.html new file mode 100644 index 0000000..4eaab94 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone.html @@ -0,0 +1,140 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone.rst new file mode 100644 index 0000000..1e9132e --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.backbone.backbone module +====================================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.html new file mode 100644 index 0000000..47d97d1 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.html @@ -0,0 +1,149 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding.html new file mode 100644 index 0000000..3c534df --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding.html @@ -0,0 +1,140 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding.rst new file mode 100644 index 0000000..ca85006 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.backbone.position\_encoding module +================================================================================================ + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.rst new file mode 100644 index 0000000..ebf2015 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.rst @@ -0,0 +1,17 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.backbone package +============================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.backbone + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.backbone + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.position_encoding + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer.html new file mode 100644 index 0000000..f65e0b9 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer.html @@ -0,0 +1,140 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer.rst new file mode 100644 index 0000000..8a7cbe9 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.backbone.swin\_transformer module +=============================================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.backbone.swin_transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper.html new file mode 100644 index 0000000..7a3ed9a --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper.rst new file mode 100644 index 0000000..77e3dac --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.bertwarper module +=============================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules.html new file mode 100644 index 0000000..d842d4f --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules.rst new file mode 100644 index 0000000..6ed4938 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.fuse\_modules module +================================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino.html new file mode 100644 index 0000000..2e6a59c --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino.rst new file mode 100644 index 0000000..f86cdef --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.groundingdino module +================================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.html new file mode 100644 index 0000000..766f19a --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.html @@ -0,0 +1,168 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn.html new file mode 100644 index 0000000..51bccf6 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn.rst new file mode 100644 index 0000000..94fb634 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.ms\_deform\_attn module +===================================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.rst new file mode 100644 index 0000000..2b52adf --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.rst @@ -0,0 +1,29 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO package +===================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.models.GroundingDINO.backbone + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.models.GroundingDINO.bertwarper + brails.filters.house_view.groundingdino.models.GroundingDINO.fuse_modules + brails.filters.house_view.groundingdino.models.GroundingDINO.groundingdino + brails.filters.house_view.groundingdino.models.GroundingDINO.ms_deform_attn + brails.filters.house_view.groundingdino.models.GroundingDINO.transformer + brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla + brails.filters.house_view.groundingdino.models.GroundingDINO.utils diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer.html new file mode 100644 index 0000000..288a5fe --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.transformer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.transformer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer.rst new file mode 100644 index 0000000..8ef7630 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.transformer module +================================================================================ + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla.html new file mode 100644 index 0000000..ffc4f42 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla.rst new file mode 100644 index 0000000..c2b673a --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.transformer\_vanilla module +========================================================================================= + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.transformer_vanilla + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.utils.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.utils.html new file mode 100644 index 0000000..f882666 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.utils.html @@ -0,0 +1,139 @@ + + + + + + + brails.filters.house_view.groundingdino.models.GroundingDINO.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.GroundingDINO.utils module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.utils.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.utils.rst new file mode 100644 index 0000000..83b6756 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.GroundingDINO.utils.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.GroundingDINO.utils module +========================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.GroundingDINO.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.html new file mode 100644 index 0000000..29b8bfb --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.html @@ -0,0 +1,172 @@ + + + + + + + brails.filters.house_view.groundingdino.models package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.registry.html b/docs/rst-code/brails.filters.house_view.groundingdino.models.registry.html new file mode 100644 index 0000000..c27de69 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.registry.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.models.registry module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.models.registry module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.registry.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.registry.rst new file mode 100644 index 0000000..b0103d8 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.registry.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.models.registry module +=============================================================== + +.. automodule:: brails.filters.house_view.groundingdino.models.registry + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.models.rst b/docs/rst-code/brails.filters.house_view.groundingdino.models.rst new file mode 100644 index 0000000..8317801 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.models.rst @@ -0,0 +1,23 @@ +brails.filters.house\_view.groundingdino.models package +======================================================= + +.. automodule:: brails.filters.house_view.groundingdino.models + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.models.GroundingDINO + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.models.registry diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.rst b/docs/rst-code/brails.filters.house_view.groundingdino.rst new file mode 100644 index 0000000..a52fe03 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.rst @@ -0,0 +1,26 @@ +brails.filters.house\_view.groundingdino package +================================================ + +.. automodule:: brails.filters.house_view.groundingdino + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.config + brails.filters.house_view.groundingdino.datasets + brails.filters.house_view.groundingdino.models + brails.filters.house_view.groundingdino.util + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.version diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.box_ops.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.box_ops.html new file mode 100644 index 0000000..1e5d179 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.box_ops.html @@ -0,0 +1,192 @@ + + + + + + + brails.filters.house_view.groundingdino.util.box_ops module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.box_ops module

+

Utilities for bounding box manipulation and GIoU.

+
+
+brails.filters.house_view.groundingdino.util.box_ops.box_cxcywh_to_xyxy(x)
+
+ +
+
+brails.filters.house_view.groundingdino.util.box_ops.box_iou(boxes1, boxes2)
+
+ +
+
+brails.filters.house_view.groundingdino.util.box_ops.box_iou_pairwise(boxes1, boxes2)
+
+ +
+
+brails.filters.house_view.groundingdino.util.box_ops.box_xyxy_to_cxcywh(x)
+
+ +
+
+brails.filters.house_view.groundingdino.util.box_ops.generalized_box_iou(boxes1, boxes2)
+

Generalized IoU from https://giou.stanford.edu/

+

The boxes should be in [x0, y0, x1, y1] format

+

Returns a [N, M] pairwise matrix, where N = len(boxes1) +and M = len(boxes2)

+
+ +
+
+brails.filters.house_view.groundingdino.util.box_ops.generalized_box_iou_pairwise(boxes1, boxes2)
+

Generalized IoU from https://giou.stanford.edu/

+
+
Input:
    +
  • boxes1, boxes2: N,4

  • +
+
+
Output:
    +
  • giou: N, 4

  • +
+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.box_ops.masks_to_boxes(masks)
+

Compute the bounding boxes around the provided masks

+

The masks should be in format [N, H, W] where N is the number of masks, (H, W) are the spatial dimensions.

+

Returns a [N, 4] tensors, with the boxes in xyxy format

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.box_ops.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.box_ops.rst new file mode 100644 index 0000000..b5003ec --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.box_ops.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.box\_ops module +============================================================= + +.. automodule:: brails.filters.house_view.groundingdino.util.box_ops + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.get_tokenlizer.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.get_tokenlizer.html new file mode 100644 index 0000000..7f4bf8b --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.get_tokenlizer.html @@ -0,0 +1,148 @@ + + + + + + + brails.filters.house_view.groundingdino.util.get_tokenlizer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.get_tokenlizer module

+
+
+brails.filters.house_view.groundingdino.util.get_tokenlizer.get_pretrained_language_model(text_encoder_type)
+
+ +
+
+brails.filters.house_view.groundingdino.util.get_tokenlizer.get_tokenlizer(text_encoder_type)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.get_tokenlizer.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.get_tokenlizer.rst new file mode 100644 index 0000000..5100c04 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.get_tokenlizer.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.get\_tokenlizer module +==================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.get_tokenlizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.html new file mode 100644 index 0000000..81a9f40 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.html @@ -0,0 +1,271 @@ + + + + + + + brails.filters.house_view.groundingdino.util package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util package

+
+

Submodules

+
+ +
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.inference.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.inference.html new file mode 100644 index 0000000..2ce8589 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.inference.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.util.inference module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.inference module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.inference.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.inference.rst new file mode 100644 index 0000000..7704c84 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.inference.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.inference module +============================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.inference + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.logger.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.logger.html new file mode 100644 index 0000000..6b9a7b2 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.logger.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.util.logger module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.logger module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.logger.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.logger.rst new file mode 100644 index 0000000..373d1ef --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.logger.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.logger module +=========================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.logger + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.misc.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.misc.html new file mode 100644 index 0000000..abeade8 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.misc.html @@ -0,0 +1,389 @@ + + + + + + + brails.filters.house_view.groundingdino.util.misc module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.misc module

+

Misc functions, including distributed helpers.

+

Mostly copy-paste from torchvision references.

+
+
+class brails.filters.house_view.groundingdino.util.misc.MetricLogger(delimiter='\t')
+

Bases: object

+
+
+add_meter(name, meter)
+
+ +
+
+log_every(iterable, print_freq, header=None, logger=None)
+
+ +
+
+synchronize_between_processes()
+
+ +
+
+update(**kwargs)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.misc.NestedTensor(tensors, mask: Tensor | None)
+

Bases: object

+
+
+decompose()
+
+ +
+
+property device
+
+ +
+
+imgsize()
+
+ +
+
+property shape
+
+ +
+
+to(device: Device) NestedTensor
+
+ +
+
+to_img_list()
+

remove the padding and convert to img list

+
+
Returns:

[type]: [description]

+
+
+
+ +
+
+to_img_list_single(tensor, mask)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.misc.SmoothedValue(window_size=20, fmt=None)
+

Bases: object

+

Track a series of values and provide access to smoothed values over a +window or the global series average.

+
+
+property avg
+
+ +
+
+property global_avg
+
+ +
+
+property max
+
+ +
+
+property median
+
+ +
+
+synchronize_between_processes()
+

Warning: does not synchronize the deque!

+
+ +
+
+update(value, n=1)
+
+ +
+
+property value
+
+ +
+ +
+
+brails.filters.house_view.groundingdino.util.misc.accuracy(output, target, topk=(1,))
+

Computes the precision@k for the specified values of k

+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.accuracy_onehot(pred, gt)
+

_summary_

+
+
Args:

pred (_type_): n, c +gt (_type_): n, c

+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.all_gather(data)
+

Run all_gather on arbitrary picklable data (not necessarily tensors) +Args:

+
+

data: any picklable object

+
+
+
Returns:

list[data]: list of data gathered from each rank

+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.all_gather_cpu(data)
+

Run all_gather on arbitrary picklable data (not necessarily tensors) +Args:

+
+

data: any picklable object

+
+
+
Returns:

list[data]: list of data gathered from each rank

+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.clean_state_dict(state_dict)
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.collate_fn(batch)
+
+ +
+
+class brails.filters.house_view.groundingdino.util.misc.color_sys(num_colors)
+

Bases: object

+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.get_rank()
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.get_sha()
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.get_world_size()
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.init_distributed_mode(args)
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.interpolate(input: Tensor, size: List[int] | None = None, scale_factor: float | None = None, mode: str = 'nearest', align_corners: bool | None = None) Tensor
+

Equivalent to nn.functional.interpolate, but with support for empty batch sizes. +This will eventually be supported natively by PyTorch, and this +class can go away.

+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.inverse_sigmoid(x, eps=0.001)
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.is_dist_avail_and_initialized()
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.is_main_process()
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.nested_tensor_from_tensor_list(tensor_list: List[Tensor])
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.reduce_dict(input_dict, average=True)
+
+
Args:

input_dict (dict): all the values will be reduced +average (bool): whether to do average or sum

+
+
+

Reduce the values in the dictionary from all processes so that all processes +have the averaged results. Returns a dict with the same fields as +input_dict, after reduction.

+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.save_on_master(*args, **kwargs)
+
+ +
+
+brails.filters.house_view.groundingdino.util.misc.setup_for_distributed(is_master)
+

This function disables printing when not in master process

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.misc.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.misc.rst new file mode 100644 index 0000000..b79d8b7 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.misc.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.misc module +========================================================= + +.. automodule:: brails.filters.house_view.groundingdino.util.misc + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.rst new file mode 100644 index 0000000..8a4f49a --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.rst @@ -0,0 +1,25 @@ +brails.filters.house\_view.groundingdino.util package +===================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino.util.box_ops + brails.filters.house_view.groundingdino.util.get_tokenlizer + brails.filters.house_view.groundingdino.util.inference + brails.filters.house_view.groundingdino.util.logger + brails.filters.house_view.groundingdino.util.misc + brails.filters.house_view.groundingdino.util.slconfig + brails.filters.house_view.groundingdino.util.slio + brails.filters.house_view.groundingdino.util.time_counter + brails.filters.house_view.groundingdino.util.utils + brails.filters.house_view.groundingdino.util.visualizer + brails.filters.house_view.groundingdino.util.vl_utils diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.slconfig.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.slconfig.html new file mode 100644 index 0000000..e3e0de3 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.slconfig.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.util.slconfig module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.slconfig module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.slconfig.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.slconfig.rst new file mode 100644 index 0000000..4bb40da --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.slconfig.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.slconfig module +============================================================= + +.. automodule:: brails.filters.house_view.groundingdino.util.slconfig + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.slio.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.slio.html new file mode 100644 index 0000000..8c57827 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.slio.html @@ -0,0 +1,289 @@ + + + + + + + brails.filters.house_view.groundingdino.util.slio module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.slio module

+
+
+class brails.filters.house_view.groundingdino.util.slio.BaseFileHandler
+

Bases: object

+
+
+abstract dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_path(obj, filepath, mode='w', **kwargs)
+
+ +
+
+abstract dump_to_str(obj, **kwargs)
+
+ +
+
+abstract load_from_fileobj(file, **kwargs)
+
+ +
+
+load_from_path(filepath, mode='r', **kwargs)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.slio.JsonHandler
+

Bases: BaseFileHandler

+
+
+dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_str(obj, **kwargs)
+
+ +
+
+load_from_fileobj(file)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.slio.PickleHandler
+

Bases: BaseFileHandler

+
+
+dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_path(obj, filepath, **kwargs)
+
+ +
+
+dump_to_str(obj, **kwargs)
+
+ +
+
+load_from_fileobj(file, **kwargs)
+
+ +
+
+load_from_path(filepath, **kwargs)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.slio.YamlHandler
+

Bases: BaseFileHandler

+
+
+dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_str(obj, **kwargs)
+
+ +
+
+load_from_fileobj(file, **kwargs)
+
+ +
+ +
+
+brails.filters.house_view.groundingdino.util.slio.is_str(x)
+

Whether the input is an string instance.

+

Note: This method is deprecated since python 2 is no longer supported.

+
+ +
+
+brails.filters.house_view.groundingdino.util.slio.sldump(obj, file=None, file_format=None, **kwargs)
+

Dump data to json/yaml/pickle strings or files.

+

This method provides a unified api for dumping data as strings or to files, +and also supports custom arguments for each file format.

+
+
Args:

obj (any): The python object to be dumped. +file (str or Path or file-like object, optional): If not

+
+

specified, then the object is dump to a str, otherwise to a file +specified by the filename or file-like object.

+
+

file_format (str, optional): Same as load().

+
+
Returns:

bool: True for success, False otherwise.

+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.slio.slload(file, file_format=None, **kwargs)
+

Load data from json/yaml/pickle files.

+

This method provides a unified api for loading data from serialized files.

+
+
Args:
+
file (str or Path or file-like object): Filename or a file-like

object.

+
+
file_format (str, optional): If not specified, the file format will be

inferred from the file extension, otherwise use the specified one. +Currently supported formats include "json", "yaml/yml" and +"pickle/pkl".

+
+
+
+
Returns:

The content from the file.

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.slio.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.slio.rst new file mode 100644 index 0000000..e2ced8f --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.slio.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.slio module +========================================================= + +.. automodule:: brails.filters.house_view.groundingdino.util.slio + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.time_counter.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.time_counter.html new file mode 100644 index 0000000..2682592 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.time_counter.html @@ -0,0 +1,187 @@ + + + + + + + brails.filters.house_view.groundingdino.util.time_counter module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.time_counter module

+
+
+class brails.filters.house_view.groundingdino.util.time_counter.AverageMeter(name, fmt=':f', val_only=False)
+

Bases: object

+

Computes and stores the average and current value

+
+
+reset()
+
+ +
+
+update(val, n=1)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.time_counter.TimeCounter
+

Bases: object

+
+
+clear()
+
+ +
+
+timeit(name)
+
+ +
+ +
+
+class brails.filters.house_view.groundingdino.util.time_counter.TimeHolder
+

Bases: object

+
+
+final_res()
+
+ +
+
+update(_timedict: dict)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.time_counter.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.time_counter.rst new file mode 100644 index 0000000..e416c5f --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.time_counter.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.time\_counter module +================================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.time_counter + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.utils.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.utils.html new file mode 100644 index 0000000..1dbb706 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.utils.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.util.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.utils module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.utils.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.utils.rst new file mode 100644 index 0000000..9056208 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.utils.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.utils module +========================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.visualizer.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.visualizer.html new file mode 100644 index 0000000..879b95a --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.visualizer.html @@ -0,0 +1,138 @@ + + + + + + + brails.filters.house_view.groundingdino.util.visualizer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.visualizer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.visualizer.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.visualizer.rst new file mode 100644 index 0000000..dba2d29 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.visualizer.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.visualizer module +=============================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.visualizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.vl_utils.html b/docs/rst-code/brails.filters.house_view.groundingdino.util.vl_utils.html new file mode 100644 index 0000000..b958917 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.vl_utils.html @@ -0,0 +1,192 @@ + + + + + + + brails.filters.house_view.groundingdino.util.vl_utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.util.vl_utils module

+
+
+brails.filters.house_view.groundingdino.util.vl_utils.build_captions_and_token_span(cat_list, force_lowercase)
+
+
Return:

captions: str +cat2tokenspan: dict

+
+
+
{

'dog': [[0, 2]], +...

+
+
+

}

+
+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.vl_utils.build_id2posspan_and_caption(category_dict: dict)
+

Build id2pos_span and caption from category_dict

+
+
Args:

category_dict (dict): category_dict

+
+
+
+ +
+
+brails.filters.house_view.groundingdino.util.vl_utils.create_positive_map_from_span(tokenized, token_span, max_text_len=256)
+

construct a map such that positive_map[i,j] = True iff box i is associated to token j +Input:

+
+
    +
  • +
    tokenized:
      +
    • input_ids: Tensor[1, ntokens]

    • +
    • attention_mask: Tensor[1, ntokens]

    • +
    +
    +
    +
  • +
  • +
    token_span: list with length num_boxes.
      +
    • each item: [start_idx, end_idx]

    • +
    +
    +
    +
  • +
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.util.vl_utils.rst b/docs/rst-code/brails.filters.house_view.groundingdino.util.vl_utils.rst new file mode 100644 index 0000000..75ee694 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.util.vl_utils.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.util.vl\_utils module +============================================================== + +.. automodule:: brails.filters.house_view.groundingdino.util.vl_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.version.html b/docs/rst-code/brails.filters.house_view.groundingdino.version.html new file mode 100644 index 0000000..72d533c --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.version.html @@ -0,0 +1,137 @@ + + + + + + + brails.filters.house_view.groundingdino.version module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.groundingdino.version module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.groundingdino.version.rst b/docs/rst-code/brails.filters.house_view.groundingdino.version.rst new file mode 100644 index 0000000..bfbe8cf --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.groundingdino.version.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.groundingdino.version module +======================================================= + +.. automodule:: brails.filters.house_view.groundingdino.version + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.house_view.html b/docs/rst-code/brails.filters.house_view.house_view.html new file mode 100644 index 0000000..eb18186 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.house_view.html @@ -0,0 +1,232 @@ + + + + + + + + + brails.filters.house_view.house_view module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view.house_view module

+
+
+class brails.filters.house_view.house_view.FilterBoundingBox(xmin: int, ymin: int, xmax: int, ymax: int)
+

Bases: object

+
+
+xmax: int
+
+ +
+
+xmin: int
+
+ +
+
+property xyxy: List[float]
+
+ +
+
+ymax: int
+
+ +
+
+ymin: int
+
+ +
+ +
+
+class brails.filters.house_view.house_view.FilterDetectionResult(score: float, label: str, box: brails.filters.house_view.house_view.FilterBoundingBox, mask: Optional[<built-in function array>] = None)
+

Bases: object

+
+
+box: FilterBoundingBox
+
+ +
+
+classmethod from_dict(detection_dict: Dict) FilterDetectionResult
+
+ +
+
+label: str
+
+ +
+
+mask: array | None = None
+
+ +
+
+score: float
+
+ +
+ +
+
+class brails.filters.house_view.house_view.HouseView(input_data: dict)
+

Bases: Filter

+
+
+filter(input_images: ImageSet, output_dir: str)
+

Abstract class that must be implemented by subclasses.

+

This method will be used by the caller to obtain a filtered ImageSet +and save the output in a specified directory.

+
+
Args:

images (ImageSet): The ImageSet to filter. +dir_path (str): Path to the output directory for filtered images.

+
+
Returns:

ImageSet: The filtered set of images.

+
+
+
+ +
+
+filter1(image_path, output_dir)
+
+ +
+ +
+
+brails.filters.house_view.house_view.detect(image: Image, labels: List[str], threshold: float = 0.3, detector_id: str | None = None) List[Dict[str, Any]]
+

Use Grounding DINO to detect a set of labels in an image in a zero-shot fashion.

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.house_view.rst b/docs/rst-code/brails.filters.house_view.house_view.rst new file mode 100644 index 0000000..bb5d15d --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.house_view.rst @@ -0,0 +1,7 @@ +brails.filters.house\_view.house\_view module +============================================= + +.. automodule:: brails.filters.house_view.house_view + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.filters.house_view.html b/docs/rst-code/brails.filters.house_view.html new file mode 100644 index 0000000..d8b2b6f --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.html @@ -0,0 +1,150 @@ + + + + + + + + + brails.filters.house_view package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters.house_view package

+
+

Subpackages

+
+
+
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.house_view.rst b/docs/rst-code/brails.filters.house_view.rst new file mode 100644 index 0000000..4025216 --- /dev/null +++ b/docs/rst-code/brails.filters.house_view.rst @@ -0,0 +1,23 @@ +brails.filters.house\_view package +================================== + +.. automodule:: brails.filters.house_view + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.groundingdino + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view.house_view diff --git a/docs/rst-code/brails.filters.html b/docs/rst-code/brails.filters.html new file mode 100644 index 0000000..4c05562 --- /dev/null +++ b/docs/rst-code/brails.filters.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.filters package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.filters package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.filters.rst b/docs/rst-code/brails.filters.rst new file mode 100644 index 0000000..9201298 --- /dev/null +++ b/docs/rst-code/brails.filters.rst @@ -0,0 +1,23 @@ +brails.filters package +====================== + +.. automodule:: brails.filters + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.house_view + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.filters.filter diff --git a/docs/rst-code/brails.html b/docs/rst-code/brails.html new file mode 100644 index 0000000..53b8c76 --- /dev/null +++ b/docs/rst-code/brails.html @@ -0,0 +1,158 @@ + + + + + + + + + brails package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails package

+

Initializations and metadata for the brails package.

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.imputers.html b/docs/rst-code/brails.imputers.html new file mode 100644 index 0000000..3d81e1a --- /dev/null +++ b/docs/rst-code/brails.imputers.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.imputers package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.imputers package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.imputers.imputation.html b/docs/rst-code/brails.imputers.imputation.html new file mode 100644 index 0000000..50d8d73 --- /dev/null +++ b/docs/rst-code/brails.imputers.imputation.html @@ -0,0 +1,162 @@ + + + + + + + + + brails.imputers.imputation module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.imputers.imputation module

+
+
+class brails.imputers.imputation.Imputation
+

Bases: ABC

+

Abstract base class representing a class that uses data imputation to fill in missing data

+
+
+
Methods:

imputate(inventory): An abstract method to fill in the missing features in an AssetInvetory

+
+
+
+
+
+abstract impute(input_inventory: AssetInventory) AssetInventory
+

Imputate an Asset Inventory

+
+
Args:

input_inventory (AssetInventory): the inventory

+
+
Returns:

AssetInventory: a new asset inventory with missing data imputed

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.imputers.imputation.rst b/docs/rst-code/brails.imputers.imputation.rst new file mode 100644 index 0000000..d206ddc --- /dev/null +++ b/docs/rst-code/brails.imputers.imputation.rst @@ -0,0 +1,7 @@ +brails.imputers.imputation module +================================= + +.. automodule:: brails.imputers.imputation + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.imputers.knn_imputer.html b/docs/rst-code/brails.imputers.knn_imputer.html new file mode 100644 index 0000000..a97d1b3 --- /dev/null +++ b/docs/rst-code/brails.imputers.knn_imputer.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.imputers.knn_imputer package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.imputers.knn_imputer package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.imputers.knn_imputer.knn_imputer.html b/docs/rst-code/brails.imputers.knn_imputer.knn_imputer.html new file mode 100644 index 0000000..7b9bd7b --- /dev/null +++ b/docs/rst-code/brails.imputers.knn_imputer.knn_imputer.html @@ -0,0 +1,213 @@ + + + + + + + + + brails.imputers.knn_imputer.knn_imputer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.imputers.knn_imputer.knn_imputer module

+
+
+class brails.imputers.knn_imputer.knn_imputer.KnnImputer
+

Bases: Imputation

+

Imputes dataset based on k-nearest neighbors in the feature-agmented space. Sequentially generate inventory

+
+
Attributes:
+
n_pw (int):

The number of possible worlds (i.e. samples or realizations) +batch_size (int):

+
+

The number of batches for sequential generation. If non-sequential, this variable is not used

+
+
+
gen_method (str):

Select “sequential” or “non-sequential” (one-shot). The latter is faster but does not generate the spatial correlation

+
+
seed (int):

For reproducibility

+
+
+
+
+
+
+

Methods:

+
+
+category_in_df_to_indices(bldg_properties_df, mask)
+
+ +
+
+clustering(bldg_properties_encoded, bldg_geometries_df, nbldg_per_cluster=500, seed=0)
+
+ +
+
+geospatial_knn(bldg_properties_encoded, mask, bldg_geometries_df)
+
+ +
+
+impute(input_inventory: AssetInventory, n_possible_worlds=1, create_correlation=True, exclude_features=[], seed=1, batch_size=50, k_nn=5) AssetInventory
+

Imputate an Asset Inventory

+
+
Args:

input_inventory (AssetInventory): the inventory

+
+
Returns:

AssetInventory: a new asset inventory with missing data imputed

+
+
+
+ +
+
+invetory_to_df(inventory)
+

Convert inventory class to df

+
+
Args:
+
inventory (AssetInventory):

the id of the asset

+
+
+
+
+
+ +
+
+sequential_imputer(sample_dic, mp_dic, bldg_impu_subset, mask_impu_subset, bldg_inde_subset, column_names, corrMat, bldg_prel_subset, bldg_geom_subset, nbrs_G, trainY_G_list, is_category, npp, gen_method='sequential')
+
+ +
+
+update_inventory(inventory, sample_dic, label_encoders, is_category)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.imputers.knn_imputer.knn_imputer.rst b/docs/rst-code/brails.imputers.knn_imputer.knn_imputer.rst new file mode 100644 index 0000000..87a9cf2 --- /dev/null +++ b/docs/rst-code/brails.imputers.knn_imputer.knn_imputer.rst @@ -0,0 +1,7 @@ +brails.imputers.knn\_imputer.knn\_imputer module +================================================ + +.. automodule:: brails.imputers.knn_imputer.knn_imputer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.imputers.knn_imputer.rst b/docs/rst-code/brails.imputers.knn_imputer.rst new file mode 100644 index 0000000..d0fae13 --- /dev/null +++ b/docs/rst-code/brails.imputers.knn_imputer.rst @@ -0,0 +1,15 @@ +brails.imputers.knn\_imputer package +==================================== + +.. automodule:: brails.imputers.knn_imputer + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.imputers.knn_imputer.knn_imputer diff --git a/docs/rst-code/brails.imputers.rst b/docs/rst-code/brails.imputers.rst new file mode 100644 index 0000000..fa6056f --- /dev/null +++ b/docs/rst-code/brails.imputers.rst @@ -0,0 +1,23 @@ +brails.imputers package +======================= + +.. automodule:: brails.imputers + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.imputers.knn_imputer + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.imputers.imputation diff --git a/docs/rst-code/brails.processors.FoundationClassifier.FoundationClassifier.html b/docs/rst-code/brails.processors.FoundationClassifier.FoundationClassifier.html new file mode 100644 index 0000000..5941542 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.FoundationClassifier.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.FoundationClassifier.FoundationClassifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.FoundationClassifier module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.FoundationClassifier.rst b/docs/rst-code/brails.processors.FoundationClassifier.FoundationClassifier.rst new file mode 100644 index 0000000..8550c09 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.FoundationClassifier.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.FoundationClassifier module +================================================================== + +.. automodule:: brails.processors.FoundationClassifier.FoundationClassifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.html b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.html new file mode 100644 index 0000000..4150eaf --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.html @@ -0,0 +1,147 @@ + + + + + + + + + brails.processors.FoundationClassifier.attention_utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.attention_utils package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.radam.html b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.radam.html new file mode 100644 index 0000000..da110ac --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.radam.html @@ -0,0 +1,211 @@ + + + + + + + + + brails.processors.FoundationClassifier.attention_utils.radam module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.attention_utils.radam module

+
+
+class brails.processors.FoundationClassifier.attention_utils.radam.AdamW(params, lr=0.001, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, warmup=0)
+

Bases: Optimizer

+
+
+step(closure=None)
+

Perform a single optimization step to update parameter.

+
+
Args:
+
closure (Callable): A closure that reevaluates the model and

returns the loss. Optional for most optimizers.

+
+
+
+
+
+

Note

+

Unless otherwise specified, this function should not modify the +.grad field of the parameters.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.attention_utils.radam.PlainRAdam(params, lr=0.001, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, degenerated_to_sgd=True)
+

Bases: Optimizer

+
+
+step(closure=None)
+

Perform a single optimization step to update parameter.

+
+
Args:
+
closure (Callable): A closure that reevaluates the model and

returns the loss. Optional for most optimizers.

+
+
+
+
+
+

Note

+

Unless otherwise specified, this function should not modify the +.grad field of the parameters.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.attention_utils.radam.RAdam(params, lr=0.001, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, degenerated_to_sgd=True)
+

Bases: Optimizer

+
+
+step(closure=None)
+

Perform a single optimization step to update parameter.

+
+
Args:
+
closure (Callable): A closure that reevaluates the model and

returns the loss. Optional for most optimizers.

+
+
+
+
+
+

Note

+

Unless otherwise specified, this function should not modify the +.grad field of the parameters.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.radam.rst b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.radam.rst new file mode 100644 index 0000000..fda3ec8 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.radam.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.attention\_utils.radam module +==================================================================== + +.. automodule:: brails.processors.FoundationClassifier.attention_utils.radam + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.rst new file mode 100644 index 0000000..1e15728 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.rst @@ -0,0 +1,16 @@ +brails.processors.FoundationClassifier.attention\_utils package +=============================================================== + +.. automodule:: brails.processors.FoundationClassifier.attention_utils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.attention_utils.radam + brails.processors.FoundationClassifier.attention_utils.utils diff --git a/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.utils.html new file mode 100644 index 0000000..40776e1 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.utils.html @@ -0,0 +1,203 @@ + + + + + + + + + brails.processors.FoundationClassifier.attention_utils.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.attention_utils.utils module

+
+
+brails.processors.FoundationClassifier.attention_utils.utils.construct_confusion_matrix_image(classes, con_mat)
+
+ +
+
+brails.processors.FoundationClassifier.attention_utils.utils.evaluate(summary_writer, mode_name, y_gt, y_pred, avg_loss, classes, epoch)
+
+ +
+
+brails.processors.FoundationClassifier.attention_utils.utils.sliding_window(data, size, stepsize=1, padded=False, axis=-1, copy=True)
+

Calculate a sliding window over a signal +Parameters +———- +data : numpy array

+
+

The array to be slided over.

+
+
+
sizeint

The sliding window size

+
+
stepsizeint

The sliding window stepsize. Defaults to 1.

+
+
axisint

The axis to slide over. Defaults to the last axis.

+
+
copybool

Return strided array as copy to avoid sideffects when manipulating the +output array.

+
+
+
+

Returns

+
+
datanumpy array

A matrix where row in last dimension consists of one instance +of the sliding window.

+
+
+
+
+

Notes

+
    +
  • Be wary of setting copy to False as undesired sideffects with the +output values may occur.

  • +
+
+
+

Examples

+
>>> a = numpy.array([1, 2, 3, 4, 5])
+>>> sliding_window(a, size=3)
+array([[1, 2, 3],
+       [2, 3, 4],
+       [3, 4, 5]])
+>>> sliding_window(a, size=3, stepsize=2)
+array([[1, 2, 3],
+       [3, 4, 5]])
+See Also
+--------
+pieces : Calculate number of pieces available by sliding
+
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.utils.rst new file mode 100644 index 0000000..736559d --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.attention_utils.utils.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.attention\_utils.utils module +==================================================================== + +.. automodule:: brails.processors.FoundationClassifier.attention_utils.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults.html new file mode 100644 index 0000000..fa70303 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults.html @@ -0,0 +1,141 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults.rst new file mode 100644 index 0000000..4f62e01 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.config.defaults module +================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.html new file mode 100644 index 0000000..d49af66 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.html @@ -0,0 +1,148 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.rst new file mode 100644 index 0000000..44132d5 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.rst @@ -0,0 +1,15 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.config package +========================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config.defaults diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data.html new file mode 100644 index 0000000..95609f0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data package

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data.rst new file mode 100644 index 0000000..562686e --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.data package +======================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.html new file mode 100644 index 0000000..a2d5fa6 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.html @@ -0,0 +1,189 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.BaseDataset(odgt, opt, **kwargs)
+

Bases: Dataset

+
+
+img_transform(img)
+
+ +
+
+parse_input_list(odgt, max_sample=-1, start_idx=-1, end_idx=-1)
+
+ +
+
+round2nearest_multiple(x, p)
+
+ +
+
+segm_transform(segm)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.TestDataset(odgt, opt, **kwargs)
+

Bases: BaseDataset

+
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.TrainDataset(root_dataset, odgt, opt, batch_per_gpu=1, **kwargs)
+

Bases: BaseDataset

+
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.ValDataset(root_dataset, odgt, opt, **kwargs)
+

Bases: BaseDataset

+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.imresize(im, size, interp='bilinear')
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.rst new file mode 100644 index 0000000..1eb3a1e --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.dataset module +========================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval.html new file mode 100644 index 0000000..0f5451f --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval.rst new file mode 100644 index 0000000..d7d900e --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.eval module +======================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro.html new file mode 100644 index 0000000..50a5c64 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro.rst new file mode 100644 index 0000000..0efe76c --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.eval\_multipro module +================================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.html new file mode 100644 index 0000000..d81d654 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.html @@ -0,0 +1,165 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.html new file mode 100644 index 0000000..1b6aab6 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.html @@ -0,0 +1,151 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib package

+
+

Subpackages

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.html new file mode 100644 index 0000000..a3cc4ed --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.html new file mode 100644 index 0000000..0680494 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.html @@ -0,0 +1,311 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.SynchronizedBatchNorm1d(num_features, eps=1e-05, momentum=0.001, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Synchronized Batch Normalization over a 2d or 3d input that is seen as a +mini-batch.

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm1d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, L) slices, it’s common terminology to call this Temporal BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of size

batch_size x num_features [x width]

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape:
    +
  • Input: \((N, C)\) or \((N, C, L)\)

  • +
  • Output: \((N, C)\) or \((N, C, L)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm1d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm1d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.SynchronizedBatchNorm2d(num_features, eps=1e-05, momentum=0.001, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Batch Normalization over a 4d input that is seen as a mini-batch +of 3d inputs

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm2d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, H, W) slices, it’s common terminology to call this Spatial BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of

size batch_size x num_features x height x width

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape:
    +
  • Input: \((N, C, H, W)\)

  • +
  • Output: \((N, C, H, W)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm2d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm2d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100, 35, 45))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.SynchronizedBatchNorm3d(num_features, eps=1e-05, momentum=0.001, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Batch Normalization over a 5d input that is seen as a mini-batch +of 4d inputs

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm3d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, D, H, W) slices, it’s common terminology to call this Volumetric BatchNorm +or Spatio-temporal BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of

size batch_size x num_features x depth x height x width

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape:
    +
  • Input: \((N, C, D, H, W)\)

  • +
  • Output: \((N, C, D, H, W)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm3d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm3d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100, 35, 45, 10))
+>>> output = m(input)
+
+
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.rst new file mode 100644 index 0000000..790e949 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.modules.batchnorm module +=========================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.html new file mode 100644 index 0000000..ded9088 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.html @@ -0,0 +1,218 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.FutureResult
+

Bases: object

+

A thread-safe future implementation. Used only as one-to-one pipe.

+
+
+get()
+
+ +
+
+put(result)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.SlavePipe(identifier, queue, result)
+

Bases: _SlavePipeBase

+

Pipe for master-slave communication.

+
+
+run_slave(msg)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.SyncMaster(master_callback)
+

Bases: object

+

An abstract SyncMaster object.

+
    +
  • During the replication, as the data parallel will trigger an callback of each module, all slave devices should

  • +
+

call register(id) and obtain an SlavePipe to communicate with the master. +- During the forward pass, master device invokes run_master, all messages from slave devices will be collected, +and passed to a registered callback. +- After receiving the messages, the master device should gather the information and determine to message passed +back to each slave devices.

+
+
+property nr_slaves
+
+ +
+
+register_slave(identifier)
+

Register an slave device.

+
+
Args:

identifier: an identifier, usually is the device id.

+
+
+

Returns: a SlavePipe object which can be used to communicate with the master device.

+
+ +
+
+run_master(master_msg)
+

Main entry for the master device in each forward pass. +The messages were first collected from each devices (including the master device), and then +an callback will be invoked to compute the message to be sent back to each devices +(including the master device).

+
+
Args:

master_msg: the message that the master want to send to itself. This will be placed as the first +message when calling master_callback. For detailed usage, see _SynchronizedBatchNorm for an example.

+
+
+

Returns: the message to be sent back to the master device.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.rst new file mode 100644 index 0000000..55dca6b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.modules.comm module +====================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.html new file mode 100644 index 0000000..e99aa51 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.html @@ -0,0 +1,155 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.html new file mode 100644 index 0000000..8836f2b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.html @@ -0,0 +1,198 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.CallbackContext
+

Bases: object

+
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.DataParallelWithCallback(module: T, device_ids: Sequence[int | device] | None = None, output_device: int | device | None = None, dim: int = 0)
+

Bases: DataParallel

+

Data Parallel with a replication callback.

+

An replication callback __data_parallel_replicate__ of each module will be invoked after being created by +original replicate function. +The callback will be invoked with arguments __data_parallel_replicate__(ctx, copy_id)

+
+
Examples:

> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1]) +# sync_bn.__data_parallel_replicate__ will be invoked.

+
+
+
+
+replicate(module, device_ids)
+
+ +
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.execute_replication_callbacks(modules)
+

Execute an replication callback __data_parallel_replicate__ on each module created by original replication.

+

The callback will be invoked with arguments __data_parallel_replicate__(ctx, copy_id)

+

Note that, as all modules are isomorphism, we assign each sub-module with a context +(shared among multiple copies of this module on different devices). +Through this context, different copies can share some information.

+

We guarantee that the callback on the master copy (the first copy) will be called ahead of calling the callback +of any slave copies.

+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.patch_replication_callback(data_parallel)
+

Monkey-patch an existing DataParallel object. Add the replication callback. +Useful when you have customized DataParallel implementation.

+
+
Examples:

> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallel(sync_bn, device_ids=[0, 1]) +> patch_replication_callback(sync_bn) +# this is equivalent to +> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1])

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.rst new file mode 100644 index 0000000..02b3045 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.modules.replicate module +=========================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.rst new file mode 100644 index 0000000..66ff475 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.rst @@ -0,0 +1,18 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.modules package +================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.batchnorm + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.comm + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.replicate + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.html new file mode 100644 index 0000000..e12852d --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.html @@ -0,0 +1,159 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.TorchTestCase(methodName='runTest')
+

Bases: TestCase

+
+
+assertTensorClose(a, b, atol=0.001, rtol=0.001)
+
+ +
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.as_numpy(v)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.rst new file mode 100644 index 0000000..af87632 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.modules.unittest module +========================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules.unittest + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.html new file mode 100644 index 0000000..3b9d633 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.html @@ -0,0 +1,164 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.UserScatteredDataParallel(module: T, device_ids: Sequence[int | device] | None = None, output_device: int | device | None = None, dim: int = 0)
+

Bases: DictGatherDataParallel

+
+
+scatter(inputs, kwargs, device_ids)
+
+ +
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.async_copy_to(obj, dev, main_stream=None)
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.user_scattered_collate(batch)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.rst new file mode 100644 index 0000000..1624a50 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.parallel.data\_parallel module +================================================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.html new file mode 100644 index 0000000..cf4811e --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.html @@ -0,0 +1,150 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.rst new file mode 100644 index 0000000..cd2e545 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.rst @@ -0,0 +1,15 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn.parallel package +=================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel.data_parallel diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.rst new file mode 100644 index 0000000..e337922 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.rst @@ -0,0 +1,16 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.nn package +========================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.modules + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn.parallel diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.rst new file mode 100644 index 0000000..ea08dca --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.rst @@ -0,0 +1,16 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib package +======================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.nn + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader.html new file mode 100644 index 0000000..dce09fe --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader.html @@ -0,0 +1,143 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader.rst new file mode 100644 index 0000000..195f839 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils.data.dataloader module +============================================================================================================ + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset.html new file mode 100644 index 0000000..076cc47 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset.html @@ -0,0 +1,143 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset.rst new file mode 100644 index 0000000..8491e58 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils.data.dataset module +========================================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed.html new file mode 100644 index 0000000..1389373 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed.html @@ -0,0 +1,143 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed.rst new file mode 100644 index 0000000..86d1813 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils.data.distributed module +============================================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.html new file mode 100644 index 0000000..09a4991 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.html @@ -0,0 +1,153 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.rst new file mode 100644 index 0000000..727c265 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.rst @@ -0,0 +1,18 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils.data package +================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataloader + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.dataset + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.distributed + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler.html new file mode 100644 index 0000000..97f30b9 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler.html @@ -0,0 +1,143 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler.rst new file mode 100644 index 0000000..5ef7184 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils.data.sampler module +========================================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data.sampler + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.html new file mode 100644 index 0000000..a3875a3 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.html @@ -0,0 +1,157 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.rst new file mode 100644 index 0000000..ec5d64b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.rst @@ -0,0 +1,23 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils package +============================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.data + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.html new file mode 100644 index 0000000..401107c --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.html @@ -0,0 +1,157 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th module

+
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.as_numpy(obj)
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.as_variable(obj)
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.mark_volatile(obj)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.rst new file mode 100644 index 0000000..25b4aa0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.lib.utils.th module +=============================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib.utils.th + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.html new file mode 100644 index 0000000..ebb0e04 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.html @@ -0,0 +1,148 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet module

+

This HRNet implementation is modified from the following repository: +https://github.com/HRNet/HRNet-Semantic-Segmentation

+
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.hrnetv2(pretrained=False, **kwargs)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.rst new file mode 100644 index 0000000..d00c9b0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models.hrnet module +=============================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.html new file mode 100644 index 0000000..66c2c10 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.html @@ -0,0 +1,153 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.html new file mode 100644 index 0000000..70fbe8b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.html @@ -0,0 +1,153 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet module

+

This MobileNetV2 implementation is modified from the following repository: +https://github.com/tonylins/pytorch-mobilenet-v2

+
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.mobilenetv2(pretrained=False, **kwargs)
+

Constructs a MobileNet_V2 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.rst new file mode 100644 index 0000000..7236a52 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models.mobilenet module +=================================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.html new file mode 100644 index 0000000..c9eed3c --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.html @@ -0,0 +1,359 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.C1(num_class=150, fc_dim=2048, use_softmax=False)
+

Bases: Module

+
+
+forward(conv_out, segSize=None)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.C1DeepSup(num_class=150, fc_dim=2048, use_softmax=False)
+

Bases: Module

+
+
+forward(conv_out, segSize=None)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.MobileNetV2Dilated(orig_net, dilate_scale=8)
+

Bases: Module

+
+
+forward(x, return_feature_maps=False)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.ModelBuilder
+

Bases: object

+
+
+static build_decoder(arch='ppm_deepsup', fc_dim=512, num_class=150, weights='', use_softmax=False)
+
+ +
+
+static build_encoder(arch='resnet50dilated', fc_dim=512, weights='')
+
+ +
+
+static weights_init(m)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.PPM(num_class=150, fc_dim=4096, use_softmax=False, pool_scales=(1, 2, 3, 6))
+

Bases: Module

+
+
+forward(conv_out, segSize=None)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.PPMDeepsup(num_class=150, fc_dim=4096, use_softmax=False, pool_scales=(1, 2, 3, 6))
+

Bases: Module

+
+
+forward(conv_out, segSize=None)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.Resnet(orig_resnet)
+

Bases: Module

+
+
+forward(x, return_feature_maps=False)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.ResnetDilated(orig_resnet, dilate_scale=8)
+

Bases: Module

+
+
+forward(x, return_feature_maps=False)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.SegmentationModule(net_enc, net_dec, crit, deep_sup_scale=None)
+

Bases: SegmentationModuleBase

+
+
+forward(feed_dict, *, segSize=None)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.SegmentationModuleBase
+

Bases: Module

+
+
+pixel_acc(pred, label)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.UPerNet(num_class=150, fc_dim=4096, use_softmax=False, pool_scales=(1, 2, 3, 6), fpn_inplanes=(256, 512, 1024, 2048), fpn_dim=256)
+

Bases: Module

+
+
+forward(conv_out, segSize=None)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.conv3x3_bn_relu(in_planes, out_planes, stride=1)
+

3x3 convolution + BN + relu

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.rst new file mode 100644 index 0000000..7a20ed0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models.models module +================================================================================================ + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.html new file mode 100644 index 0000000..e26970d --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.html @@ -0,0 +1,191 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.ResNet(block, layers, num_classes=1000)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.resnet101(pretrained=False, **kwargs)
+

Constructs a ResNet-101 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.resnet18(pretrained=False, **kwargs)
+

Constructs a ResNet-18 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.resnet50(pretrained=False, **kwargs)
+

Constructs a ResNet-50 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.rst new file mode 100644 index 0000000..ef9665a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models.resnet module +================================================================================================ + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.html new file mode 100644 index 0000000..1d473bb --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.html @@ -0,0 +1,171 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.ResNeXt(block, layers, groups=32, num_classes=1000)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.resnext101(pretrained=False, **kwargs)
+

Constructs a ResNet-101 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on Places

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.rst new file mode 100644 index 0000000..9026c27 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models.resnext module +================================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.rst new file mode 100644 index 0000000..5e700d5 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.rst @@ -0,0 +1,20 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models package +========================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.hrnet + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.mobilenet + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.models + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnet + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.resnext + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.html new file mode 100644 index 0000000..c3bd32d --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.html @@ -0,0 +1,146 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils module

+
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.load_url(url, model_dir='./pretrained', map_location=None)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.rst new file mode 100644 index 0000000..520691f --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.models.utils module +=============================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.rst new file mode 100644 index 0000000..2b4684a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.rst @@ -0,0 +1,31 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg package +=================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.config + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.data + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.lib + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.models + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.dataset + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.eval_multipro + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test.html new file mode 100644 index 0000000..c10091a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test.rst new file mode 100644 index 0000000..f2a05cf --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.test module +======================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.test + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train.html new file mode 100644 index 0000000..d163952 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train.rst new file mode 100644 index 0000000..57fb42b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.train module +======================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.train + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.html new file mode 100644 index 0000000..9d2bf21 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.html @@ -0,0 +1,220 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils module

+
+
+class brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.AverageMeter
+

Bases: object

+

Computes and stores the average and current value

+
+
+add(val, weight)
+
+ +
+
+average()
+
+ +
+
+initialize(val, weight)
+
+ +
+
+update(val, weight=1)
+
+ +
+
+value()
+
+ +
+ +
+
+exception brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.NotSupportedCliException
+

Bases: Exception

+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.accuracy(preds, label)
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.colorEncode(labelmap, colors, mode='RGB')
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.find_recursive(root_dir, ext='.jpg')
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.intersectionAndUnion(imPred, imLab, numClass)
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.parse_devices(input_devices)
+

Parse user’s devices input str to standard format. +e.g. [gpu0, gpu1, …]

+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.process_range(xpu, inp)
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.setup_logger(distributed_rank=0, filename='log.txt')
+
+ +
+
+brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.unique(ar, return_index=False, return_inverse=False, return_counts=False)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.rst new file mode 100644 index 0000000..c58befc --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_seg.utils module +======================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation.html new file mode 100644 index 0000000..4603fec --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation.rst new file mode 100644 index 0000000..ebe3c46 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool.csail\_segmentation module +=========================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.html b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.html new file mode 100644 index 0000000..6052211 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.html @@ -0,0 +1,156 @@ + + + + + + + + + brails.processors.FoundationClassifier.csail_segmentation_tool package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.csail_segmentation_tool package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.rst b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.rst new file mode 100644 index 0000000..d55df31 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.csail_segmentation_tool.rst @@ -0,0 +1,23 @@ +brails.processors.FoundationClassifier.csail\_segmentation\_tool package +======================================================================== + +.. automodule:: brails.processors.FoundationClassifier.csail_segmentation_tool + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_seg + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.csail_segmentation_tool.csail_segmentation diff --git a/docs/rst-code/brails.processors.FoundationClassifier.detect.html b/docs/rst-code/brails.processors.FoundationClassifier.detect.html new file mode 100644 index 0000000..ec35555 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.detect.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.FoundationClassifier.detect module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.detect module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.detect.rst b/docs/rst-code/brails.processors.FoundationClassifier.detect.rst new file mode 100644 index 0000000..61f94ab --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.detect.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.detect module +==================================================== + +.. automodule:: brails.processors.FoundationClassifier.detect + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.html b/docs/rst-code/brails.processors.FoundationClassifier.html new file mode 100644 index 0000000..14fb725 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.html @@ -0,0 +1,163 @@ + + + + + + + + + brails.processors.FoundationClassifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.LinearAverage.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.LinearAverage.html new file mode 100644 index 0000000..e0b0c07 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.LinearAverage.html @@ -0,0 +1,231 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.LinearAverage module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.LinearAverage module

+
+
+class brails.processors.FoundationClassifier.lib.LinearAverage.LinearAverage(inputSize, outputSize, T=0.07, momentum=0.5)
+

Bases: Module

+
+
+forward(x, y)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.lib.LinearAverage.LinearAverageOp(*args, **kwargs)
+

Bases: Function

+
+
+static backward(self, gradOutput)
+

Define a formula for differentiating the operation with backward mode automatic differentiation.

+

This function is to be overridden by all subclasses. +(Defining this function is equivalent to defining the vjp function.)

+

It must accept a context ctx as the first argument, followed by +as many outputs as the forward() returned (None will be passed in +for non tensor outputs of the forward function), +and it should return as many tensors, as there were inputs to +forward(). Each argument is the gradient w.r.t the given output, +and each returned value should be the gradient w.r.t. the +corresponding input. If an input is not a Tensor or is a Tensor not +requiring grads, you can just pass None as a gradient for that input.

+

The context can be used to retrieve tensors saved during the forward +pass. It also has an attribute ctx.needs_input_grad as a tuple +of booleans representing whether each input needs gradient. E.g., +backward() will have ctx.needs_input_grad[0] = True if the +first input to forward() needs gradient computed w.r.t. the +output.

+
+ +
+
+static forward(self, x, y, memory, params)
+

Define the forward of the custom autograd Function.

+

This function is to be overridden by all subclasses. +There are two ways to define forward:

+

Usage 1 (Combined forward and ctx):

+
@staticmethod
+def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any:
+    pass
+
+
+
    +
  • It must accept a context ctx as the first argument, followed by any +number of arguments (tensors or other types).

  • +
  • See combining-forward-context for more details

  • +
+

Usage 2 (Separate forward and ctx):

+
@staticmethod
+def forward(*args: Any, **kwargs: Any) -> Any:
+    pass
+
+@staticmethod
+def setup_context(ctx: Any, inputs: Tuple[Any, ...], output: Any) -> None:
+    pass
+
+
+
    +
  • The forward no longer accepts a ctx argument.

  • +
  • Instead, you must also override the torch.autograd.Function.setup_context() +staticmethod to handle setting up the ctx object. +output is the output of the forward, inputs are a Tuple of inputs +to the forward.

  • +
  • See extending-autograd for more details

  • +
+

The context can be used to store arbitrary data that can be then +retrieved during the backward pass. Tensors should not be stored +directly on ctx (though this is not currently enforced for +backward compatibility). Instead, tensors should be saved either with +ctx.save_for_backward() if they are intended to be used in +backward (equivalently, vjp) or ctx.save_for_forward() +if they are intended to be used for in jvp.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.LinearAverage.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.LinearAverage.rst new file mode 100644 index 0000000..ee9ed07 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.LinearAverage.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.LinearAverage module +=============================================================== + +.. automodule:: brails.processors.FoundationClassifier.lib.LinearAverage + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.NCEAverage.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCEAverage.html new file mode 100644 index 0000000..a1d5896 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCEAverage.html @@ -0,0 +1,231 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.NCEAverage module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.NCEAverage module

+
+
+class brails.processors.FoundationClassifier.lib.NCEAverage.NCEAverage(inputSize, outputSize, K, T=0.07, momentum=0.5, Z=None)
+

Bases: Module

+
+
+forward(x, y)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.lib.NCEAverage.NCEFunction(*args, **kwargs)
+

Bases: Function

+
+
+static backward(self, gradOutput)
+

Define a formula for differentiating the operation with backward mode automatic differentiation.

+

This function is to be overridden by all subclasses. +(Defining this function is equivalent to defining the vjp function.)

+

It must accept a context ctx as the first argument, followed by +as many outputs as the forward() returned (None will be passed in +for non tensor outputs of the forward function), +and it should return as many tensors, as there were inputs to +forward(). Each argument is the gradient w.r.t the given output, +and each returned value should be the gradient w.r.t. the +corresponding input. If an input is not a Tensor or is a Tensor not +requiring grads, you can just pass None as a gradient for that input.

+

The context can be used to retrieve tensors saved during the forward +pass. It also has an attribute ctx.needs_input_grad as a tuple +of booleans representing whether each input needs gradient. E.g., +backward() will have ctx.needs_input_grad[0] = True if the +first input to forward() needs gradient computed w.r.t. the +output.

+
+ +
+
+static forward(self, x, y, memory, idx, params)
+

Define the forward of the custom autograd Function.

+

This function is to be overridden by all subclasses. +There are two ways to define forward:

+

Usage 1 (Combined forward and ctx):

+
@staticmethod
+def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any:
+    pass
+
+
+
    +
  • It must accept a context ctx as the first argument, followed by any +number of arguments (tensors or other types).

  • +
  • See combining-forward-context for more details

  • +
+

Usage 2 (Separate forward and ctx):

+
@staticmethod
+def forward(*args: Any, **kwargs: Any) -> Any:
+    pass
+
+@staticmethod
+def setup_context(ctx: Any, inputs: Tuple[Any, ...], output: Any) -> None:
+    pass
+
+
+
    +
  • The forward no longer accepts a ctx argument.

  • +
  • Instead, you must also override the torch.autograd.Function.setup_context() +staticmethod to handle setting up the ctx object. +output is the output of the forward, inputs are a Tuple of inputs +to the forward.

  • +
  • See extending-autograd for more details

  • +
+

The context can be used to store arbitrary data that can be then +retrieved during the backward pass. Tensors should not be stored +directly on ctx (though this is not currently enforced for +backward compatibility). Instead, tensors should be saved either with +ctx.save_for_backward() if they are intended to be used in +backward (equivalently, vjp) or ctx.save_for_forward() +if they are intended to be used for in jvp.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.NCEAverage.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCEAverage.rst new file mode 100644 index 0000000..45f3627 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCEAverage.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.NCEAverage module +============================================================ + +.. automodule:: brails.processors.FoundationClassifier.lib.NCEAverage + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.NCECriterion.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCECriterion.html new file mode 100644 index 0000000..942188a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCECriterion.html @@ -0,0 +1,159 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.NCECriterion module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.NCECriterion module

+
+
+class brails.processors.FoundationClassifier.lib.NCECriterion.NCECriterion(nLem)
+

Bases: Module

+
+
+forward(x, targets)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.NCECriterion.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCECriterion.rst new file mode 100644 index 0000000..fc36339 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.NCECriterion.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.NCECriterion module +============================================================== + +.. automodule:: brails.processors.FoundationClassifier.lib.NCECriterion + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.alias_multinomial.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.alias_multinomial.html new file mode 100644 index 0000000..91eb00f --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.alias_multinomial.html @@ -0,0 +1,157 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.alias_multinomial module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.alias_multinomial module

+
+
+class brails.processors.FoundationClassifier.lib.alias_multinomial.AliasMethod(probs)
+

Bases: object

+

From: https://hips.seas.harvard.edu/blog/2013/03/03/the-alias-method-efficient-sampling-with-many-discrete-outcomes/

+
+
+cuda()
+
+ +
+
+draw(N)
+

Draw N samples from multinomial

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.alias_multinomial.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.alias_multinomial.rst new file mode 100644 index 0000000..597c99b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.alias_multinomial.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.alias\_multinomial module +==================================================================== + +.. automodule:: brails.processors.FoundationClassifier.lib.alias_multinomial + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.custom_transforms.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.custom_transforms.html new file mode 100644 index 0000000..7a57db4 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.custom_transforms.html @@ -0,0 +1,310 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.custom_transforms module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.custom_transforms module

+
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.AddGaussianNoise(mean, sigma, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Add gaussian noise to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.AddGaussianPoissonNoise(sigma, peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Add poisson noise with gaussian blurred image to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.AddSpeckleNoise(mean, sigma, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Add speckle noise to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.BilinearResize(zoom)
+

Bases: object

+

Resize a PIL.Image or numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.CenterCropNumpy(size)
+

Bases: object

+

Crops the given numpy array at the center to have a region of +the given size. size can be a tuple (target_height, target_width) +or an integer, in which case the target will be of a square shape (size, size)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.ElasticTransform(alpha, sigma)
+

Bases: object

+

Apply elastic transformation on a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.EnhancedCompose(transforms)
+

Bases: object

+

Composes several transforms together. +Args:

+
+

transforms (List[Transform]): list of transforms to compose.

+
+
+
Example:
>>> transforms.Compose([
+>>>     transforms.CenterCrop(10),
+>>>     transforms.ToTensor(),
+>>> ])
+
+
+
+
+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.MaxScaleNumpy(range_min=0.0, range_max=1.0)
+

Bases: object

+

scale with max and min of each channel of the numpy array i.e. +channel = (channel - mean) / std

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.MedianScaleNumpy(range_min=0.0, range_max=1.0)
+

Bases: object

+

Scale with median and mean of each channel of the numpy array i.e. +channel = (channel - mean) / std

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.Merge(axis=-1)
+

Bases: object

+

Merge a group of images

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.MutualExclude(exclude_channel, from_channel)
+

Bases: object

+

Remove elements from one channel

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.NormalizeNumpy
+

Bases: object

+

Normalize each channel of the numpy array i.e. +channel = (channel - mean) / std

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.PoissonSubsampling(peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Poisson subsampling on a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.RandomCropNumpy(size, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Crops the given numpy array at a random location to have a region of +the given size. size can be a tuple (target_height, target_width) +or an integer, in which case the target will be of a square shape (size, size)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.RandomGaussianBlurring(sigma, p=0.2, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Apply gaussian blur to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.RandomRotate(angle_range=(0.0, 360.0), axes=(0, 1), mode='reflect', random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Rotate a PIL.Image or numpy.ndarray (H x W x C) randomly

+
+ +
+
+class brails.processors.FoundationClassifier.lib.custom_transforms.Split(*slices, **kwargs)
+

Bases: object

+

Split images into individual arrays

+
+ +
+
+brails.processors.FoundationClassifier.lib.custom_transforms.center_crop(x, center_crop_size)
+
+ +
+
+brails.processors.FoundationClassifier.lib.custom_transforms.elastic_transform(image, alpha=1000, sigma=30, spline_order=1, mode='nearest', random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Elastic deformation of image as described in [Simard2003]. +.. [Simard2003] Simard, Steinkraus and Platt, “Best Practices for

+
+

Convolutional Neural Networks applied to Visual Document Analysis”, in +Proc. of the International Conference on Document Analysis and +Recognition, 2003.

+
+
+ +
+
+brails.processors.FoundationClassifier.lib.custom_transforms.poisson_downsampling(image, peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+
+ +
+
+brails.processors.FoundationClassifier.lib.custom_transforms.random_num_generator(config, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+
+ +
+
+brails.processors.FoundationClassifier.lib.custom_transforms.to_tensor(x)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.custom_transforms.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.custom_transforms.rst new file mode 100644 index 0000000..08eee82 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.custom_transforms.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.custom\_transforms module +==================================================================== + +.. automodule:: brails.processors.FoundationClassifier.lib.custom_transforms + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.html new file mode 100644 index 0000000..7589117 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.normalize.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.normalize.html new file mode 100644 index 0000000..3207149 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.normalize.html @@ -0,0 +1,159 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.normalize module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.normalize module

+
+
+class brails.processors.FoundationClassifier.lib.normalize.Normalize(power=2)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.normalize.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.normalize.rst new file mode 100644 index 0000000..aede299 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.normalize.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.normalize module +=========================================================== + +.. automodule:: brails.processors.FoundationClassifier.lib.normalize + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.rst new file mode 100644 index 0000000..98f8b86 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.rst @@ -0,0 +1,21 @@ +brails.processors.FoundationClassifier.lib package +================================================== + +.. automodule:: brails.processors.FoundationClassifier.lib + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.lib.LinearAverage + brails.processors.FoundationClassifier.lib.NCEAverage + brails.processors.FoundationClassifier.lib.NCECriterion + brails.processors.FoundationClassifier.lib.alias_multinomial + brails.processors.FoundationClassifier.lib.custom_transforms + brails.processors.FoundationClassifier.lib.normalize + brails.processors.FoundationClassifier.lib.utils diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.lib.utils.html new file mode 100644 index 0000000..a1cf0d1 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.utils.html @@ -0,0 +1,156 @@ + + + + + + + + + brails.processors.FoundationClassifier.lib.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.lib.utils module

+
+
+class brails.processors.FoundationClassifier.lib.utils.AverageMeter
+

Bases: object

+

Computes and stores the average and current value

+
+
+reset()
+
+ +
+
+update(val, n=1)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.lib.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.lib.utils.rst new file mode 100644 index 0000000..41fb222 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.lib.utils.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.lib.utils module +======================================================= + +.. automodule:: brails.processors.FoundationClassifier.lib.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.attention_module.html b/docs/rst-code/brails.processors.FoundationClassifier.models.attention_module.html new file mode 100644 index 0000000..70eb87d --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.attention_module.html @@ -0,0 +1,299 @@ + + + + + + + + + brails.processors.FoundationClassifier.models.attention_module module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.models.attention_module module

+
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_pre(in_channels, out_channels, size1, size2, size3)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage0(in_channels, out_channels, size1=(112, 112), size2=(56, 56), size3=(28, 28), size4=(14, 14))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage1(in_channels, out_channels, size1=(56, 56), size2=(28, 28), size3=(14, 14))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage1_cifar(in_channels, out_channels, size1=(16, 16), size2=(8, 8))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage2(in_channels, out_channels, size1=(28, 28), size2=(14, 14))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage2_cifar(in_channels, out_channels, size=(8, 8))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage3(in_channels, out_channels, size1=(14, 14))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.attention_module.AttentionModule_stage3_cifar(in_channels, out_channels, size=(8, 8))
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.attention_module.rst b/docs/rst-code/brails.processors.FoundationClassifier.models.attention_module.rst new file mode 100644 index 0000000..795b765 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.attention_module.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.models.attention\_module module +====================================================================== + +.. automodule:: brails.processors.FoundationClassifier.models.attention_module + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.basic_layer.html b/docs/rst-code/brails.processors.FoundationClassifier.models.basic_layer.html new file mode 100644 index 0000000..7260f3a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.basic_layer.html @@ -0,0 +1,179 @@ + + + + + + + + + brails.processors.FoundationClassifier.models.basic_layer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.models.basic_layer module

+
+
+class brails.processors.FoundationClassifier.models.basic_layer.ResidualBlock(in_channel, out_channel, stride=1)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.basic_layer.ResidualBlock1D(in_channel, out_channel, stride=1)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.basic_layer.rst b/docs/rst-code/brails.processors.FoundationClassifier.models.basic_layer.rst new file mode 100644 index 0000000..f2f3fc6 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.basic_layer.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.models.basic\_layer module +================================================================= + +.. automodule:: brails.processors.FoundationClassifier.models.basic_layer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.html b/docs/rst-code/brails.processors.FoundationClassifier.models.html new file mode 100644 index 0000000..e006005 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.html @@ -0,0 +1,150 @@ + + + + + + + + + brails.processors.FoundationClassifier.models package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.residual_attention_network.html b/docs/rst-code/brails.processors.FoundationClassifier.models.residual_attention_network.html new file mode 100644 index 0000000..1c99c6b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.residual_attention_network.html @@ -0,0 +1,279 @@ + + + + + + + + + brails.processors.FoundationClassifier.models.residual_attention_network module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.models.residual_attention_network module

+
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.DenseBlock(input_size, output_size, last_layer=False, dropout_p=0.0)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.MLP(input_size, hidden_size, num_classes, num_dense_layers=6, dropout_p=0.0)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.ResidualAttentionModel_92(output_dim_ffe, dropout=False)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.ResidualAttentionModel_92_32input(output_dim)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.ResidualAttentionModel_92_32input_update(output_dim)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.ResidualAttentionModel_92_Small(output_dim=6, dropout=False)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.residual_attention_network.ResidualAttentionModel_92_Small_1D(output_dim=6, dropout=False)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.residual_attention_network.rst b/docs/rst-code/brails.processors.FoundationClassifier.models.residual_attention_network.rst new file mode 100644 index 0000000..f82d94a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.residual_attention_network.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.models.residual\_attention\_network module +================================================================================= + +.. automodule:: brails.processors.FoundationClassifier.models.residual_attention_network + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.resnet_applied.html b/docs/rst-code/brails.processors.FoundationClassifier.models.resnet_applied.html new file mode 100644 index 0000000..9e45d53 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.resnet_applied.html @@ -0,0 +1,209 @@ + + + + + + + + + brails.processors.FoundationClassifier.models.resnet_applied module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.models.resnet_applied module

+
+
+class brails.processors.FoundationClassifier.models.resnet_applied.ResNet(block, layers, low_dim=128)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.models.resnet_applied.resnet101(pretrained=False, **kwargs)
+

Constructs a ResNet-101 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.models.resnet_applied.resnet152(pretrained=False, **kwargs)
+

Constructs a ResNet-152 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.models.resnet_applied.resnet18(pretrained=False, **kwargs)
+

Constructs a ResNet-18 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.models.resnet_applied.resnet34(pretrained=False, **kwargs)
+

Constructs a ResNet-34 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.models.resnet_applied.resnet50(pretrained=False, **kwargs)
+

Constructs a ResNet-50 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.resnet_applied.rst b/docs/rst-code/brails.processors.FoundationClassifier.models.resnet_applied.rst new file mode 100644 index 0000000..518ca2c --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.resnet_applied.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.models.resnet\_applied module +==================================================================== + +.. automodule:: brails.processors.FoundationClassifier.models.resnet_applied + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.rst b/docs/rst-code/brails.processors.FoundationClassifier.models.rst new file mode 100644 index 0000000..b6c4772 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.rst @@ -0,0 +1,19 @@ +brails.processors.FoundationClassifier.models package +===================================================== + +.. automodule:: brails.processors.FoundationClassifier.models + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.models.attention_module + brails.processors.FoundationClassifier.models.basic_layer + brails.processors.FoundationClassifier.models.residual_attention_network + brails.processors.FoundationClassifier.models.resnet_applied + brails.processors.FoundationClassifier.models.sknet diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.sknet.html b/docs/rst-code/brails.processors.FoundationClassifier.models.sknet.html new file mode 100644 index 0000000..8ea2fb2 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.sknet.html @@ -0,0 +1,214 @@ + + + + + + + + + brails.processors.FoundationClassifier.models.sknet module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.models.sknet module

+
+
+class brails.processors.FoundationClassifier.models.sknet.SKConv(features, M=2, G=32, r=16, stride=1, L=32)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.models.sknet.SKNet(class_num, nums_block_list=[3, 4, 6, 3], strides_list=[1, 2, 2, 2])
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.models.sknet.SKNet101(nums_class=1000)
+
+ +
+
+brails.processors.FoundationClassifier.models.sknet.SKNet26(nums_class=1000)
+
+ +
+
+brails.processors.FoundationClassifier.models.sknet.SKNet50(nums_class=1000)
+
+ +
+
+class brails.processors.FoundationClassifier.models.sknet.SKUnit(in_features, mid_features, out_features, M=2, G=32, r=16, stride=1, L=32)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.models.sknet.rst b/docs/rst-code/brails.processors.FoundationClassifier.models.sknet.rst new file mode 100644 index 0000000..bf476bf --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.models.sknet.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.models.sknet module +========================================================== + +.. automodule:: brails.processors.FoundationClassifier.models.sknet + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.MDistance.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.MDistance.html new file mode 100644 index 0000000..9a6143a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.MDistance.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.MDistance module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.MDistance module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.MDistance.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.MDistance.rst new file mode 100644 index 0000000..4d3c4c7 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.MDistance.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.MDistance module +============================================================ + +.. automodule:: brails.processors.FoundationClassifier.npid.MDistance + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.cifar.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.cifar.html new file mode 100644 index 0000000..e64adc9 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.cifar.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.cifar module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.cifar module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.cifar.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.cifar.rst new file mode 100644 index 0000000..1eef48c --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.cifar.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.cifar module +======================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.cifar + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.html new file mode 100644 index 0000000..fadb627 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.main.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.main.html new file mode 100644 index 0000000..ee59845 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.main.html @@ -0,0 +1,166 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.main module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.main module

+
+
+brails.processors.FoundationClassifier.npid.main.accuracy(output, target, topk=(1,))
+

Computes the precision@k for the specified values of k

+
+ +
+
+brails.processors.FoundationClassifier.npid.main.adjust_learning_rate(optimizer, epoch)
+

Sets the learning rate to the initial LR decayed by 10 every 100 epochs

+
+ +
+
+brails.processors.FoundationClassifier.npid.main.main()
+
+ +
+
+brails.processors.FoundationClassifier.npid.main.save_checkpoint(state, is_best, prefix, filename='checkpoint.pth.tar')
+
+ +
+
+brails.processors.FoundationClassifier.npid.main.train(train_loader, model, lemniscate, criterion, optimizer, epoch)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.main.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.main.rst new file mode 100644 index 0000000..25665eb --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.main.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.main module +======================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.main + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.cifar.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.cifar.html new file mode 100644 index 0000000..e08d78b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.cifar.html @@ -0,0 +1,190 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_datasets.cifar module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_datasets.cifar module

+
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.cifar.CIFAR100Instance(root: str | Path, train: bool = True, transform: Callable | None = None, target_transform: Callable | None = None, download: bool = False)
+

Bases: CIFAR10Instance

+

CIFAR100Instance Dataset.

+

This is a subclass of the CIFAR10Instance Dataset.

+
+
+base_folder = 'cifar-100-python'
+
+ +
+
+data: Any
+
+ +
+
+filename = 'cifar-100-python.tar.gz'
+
+ +
+
+test_list = [['test', 'f0ef6b0ae62326f3e7ffdfab6717acfc']]
+
+ +
+
+tgz_md5 = 'eb9058c3a382ffc7106e4002c42a8d85'
+
+ +
+
+train_list = [['train', '16019d7e3df5f24257cddd939b257f8d']]
+
+ +
+
+url = 'https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz'
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.cifar.CIFAR10Instance(root: str | Path, train: bool = True, transform: Callable | None = None, target_transform: Callable | None = None, download: bool = False)
+

Bases: CIFAR10

+

CIFAR10Instance Dataset.

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.cifar.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.cifar.rst new file mode 100644 index 0000000..23bd313 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.cifar.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_datasets.cifar module +======================================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_datasets.cifar + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.folder.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.folder.html new file mode 100644 index 0000000..32905da --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.folder.html @@ -0,0 +1,166 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_datasets.folder module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_datasets.folder module

+
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.folder.CombinedMaskDataset(other_data_path=None, csv_root_folder=None, data_csv=None, transform=None, mask_images=True, attribute=None)
+

Bases: Dataset

+

: Slightly hackish way to train on masks quick

+
+
+loader(path)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.folder.ImageFolderInstance(root: str | ~pathlib.Path, transform: ~typing.Callable | None = None, target_transform: ~typing.Callable | None = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>, is_valid_file: ~typing.Callable[[str], bool] | None = None, allow_empty: bool = False)
+

Bases: ImageFolder

+

: Folder datasets which returns the index of the image as well:

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.folder.MaskFolderInstance(*args, **kwargs)
+

Bases: ImageFolder

+

: Slightly hackish way to train on masks quick

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.folder.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.folder.rst new file mode 100644 index 0000000..6157ab0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.folder.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_datasets.folder module +======================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_datasets.folder + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.html new file mode 100644 index 0000000..1977bc7 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.html @@ -0,0 +1,232 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_datasets package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_datasets package

+
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.CIFAR100Instance(root: str | Path, train: bool = True, transform: Callable | None = None, target_transform: Callable | None = None, download: bool = False)
+

Bases: CIFAR10Instance

+

CIFAR100Instance Dataset.

+

This is a subclass of the CIFAR10Instance Dataset.

+
+
+base_folder = 'cifar-100-python'
+
+ +
+
+data: Any
+
+ +
+
+filename = 'cifar-100-python.tar.gz'
+
+ +
+
+test_list = [['test', 'f0ef6b0ae62326f3e7ffdfab6717acfc']]
+
+ +
+
+tgz_md5 = 'eb9058c3a382ffc7106e4002c42a8d85'
+
+ +
+
+train_list = [['train', '16019d7e3df5f24257cddd939b257f8d']]
+
+ +
+
+url = 'https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz'
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.CIFAR10Instance(root: str | Path, train: bool = True, transform: Callable | None = None, target_transform: Callable | None = None, download: bool = False)
+

Bases: CIFAR10

+

CIFAR10Instance Dataset.

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.CombinedMaskDataset(other_data_path=None, csv_root_folder=None, data_csv=None, transform=None, mask_images=True, attribute=None)
+

Bases: Dataset

+

: Slightly hackish way to train on masks quick

+
+
+loader(path)
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.ImageFolderInstance(root: str | ~pathlib.Path, transform: ~typing.Callable | None = None, target_transform: ~typing.Callable | None = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>, is_valid_file: ~typing.Callable[[str], bool] | None = None, allow_empty: bool = False)
+

Bases: ImageFolder

+

: Folder datasets which returns the index of the image as well:

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.MNISTInstance(root: str | Path, train: bool = True, transform: Callable | None = None, target_transform: Callable | None = None, download: bool = False)
+

Bases: MNIST

+

MNIST Instance Dataset.

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.MaskFolderInstance(*args, **kwargs)
+

Bases: ImageFolder

+

: Slightly hackish way to train on masks quick

+
+ +
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.mnist.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.mnist.html new file mode 100644 index 0000000..dcd62d9 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.mnist.html @@ -0,0 +1,147 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_datasets.mnist module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_datasets.mnist module

+
+
+class brails.processors.FoundationClassifier.npid.npid_datasets.mnist.MNISTInstance(root: str | Path, train: bool = True, transform: Callable | None = None, target_transform: Callable | None = None, download: bool = False)
+

Bases: MNIST

+

MNIST Instance Dataset.

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.mnist.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.mnist.rst new file mode 100644 index 0000000..05691e4 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.mnist.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_datasets.mnist module +======================================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_datasets.mnist + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.rst new file mode 100644 index 0000000..6c79768 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_datasets.rst @@ -0,0 +1,17 @@ +brails.processors.FoundationClassifier.npid.npid\_datasets package +================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_datasets + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.npid.npid_datasets.cifar + brails.processors.FoundationClassifier.npid.npid_datasets.folder + brails.processors.FoundationClassifier.npid.npid_datasets.mnist diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.html new file mode 100644 index 0000000..571cb8d --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.html @@ -0,0 +1,232 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.LinearAverage(inputSize, outputSize, T=0.07, momentum=0.5)
+

Bases: Module

+
+
+forward(x, y)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.LinearAverageOp(*args, **kwargs)
+

Bases: Function

+
+
+static backward(self, gradOutput)
+

Define a formula for differentiating the operation with backward mode automatic differentiation.

+

This function is to be overridden by all subclasses. +(Defining this function is equivalent to defining the vjp function.)

+

It must accept a context ctx as the first argument, followed by +as many outputs as the forward() returned (None will be passed in +for non tensor outputs of the forward function), +and it should return as many tensors, as there were inputs to +forward(). Each argument is the gradient w.r.t the given output, +and each returned value should be the gradient w.r.t. the +corresponding input. If an input is not a Tensor or is a Tensor not +requiring grads, you can just pass None as a gradient for that input.

+

The context can be used to retrieve tensors saved during the forward +pass. It also has an attribute ctx.needs_input_grad as a tuple +of booleans representing whether each input needs gradient. E.g., +backward() will have ctx.needs_input_grad[0] = True if the +first input to forward() needs gradient computed w.r.t. the +output.

+
+ +
+
+static forward(self, x, y, memory, params)
+

Define the forward of the custom autograd Function.

+

This function is to be overridden by all subclasses. +There are two ways to define forward:

+

Usage 1 (Combined forward and ctx):

+
@staticmethod
+def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any:
+    pass
+
+
+
    +
  • It must accept a context ctx as the first argument, followed by any +number of arguments (tensors or other types).

  • +
  • See combining-forward-context for more details

  • +
+

Usage 2 (Separate forward and ctx):

+
@staticmethod
+def forward(*args: Any, **kwargs: Any) -> Any:
+    pass
+
+@staticmethod
+def setup_context(ctx: Any, inputs: Tuple[Any, ...], output: Any) -> None:
+    pass
+
+
+
    +
  • The forward no longer accepts a ctx argument.

  • +
  • Instead, you must also override the torch.autograd.Function.setup_context() +staticmethod to handle setting up the ctx object. +output is the output of the forward, inputs are a Tuple of inputs +to the forward.

  • +
  • See extending-autograd for more details

  • +
+

The context can be used to store arbitrary data that can be then +retrieved during the backward pass. Tensors should not be stored +directly on ctx (though this is not currently enforced for +backward compatibility). Instead, tensors should be saved either with +ctx.save_for_backward() if they are intended to be used in +backward (equivalently, vjp) or ctx.save_for_forward() +if they are intended to be used for in jvp.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.rst new file mode 100644 index 0000000..5696303 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.LinearAverage module +========================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.html new file mode 100644 index 0000000..7b43797 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.html @@ -0,0 +1,232 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.NCEAverage(inputSize, outputSize, K, T=0.07, momentum=0.5, Z=None)
+

Bases: Module

+
+
+forward(x, y)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.NCEFunction(*args, **kwargs)
+

Bases: Function

+
+
+static backward(self, gradOutput)
+

Define a formula for differentiating the operation with backward mode automatic differentiation.

+

This function is to be overridden by all subclasses. +(Defining this function is equivalent to defining the vjp function.)

+

It must accept a context ctx as the first argument, followed by +as many outputs as the forward() returned (None will be passed in +for non tensor outputs of the forward function), +and it should return as many tensors, as there were inputs to +forward(). Each argument is the gradient w.r.t the given output, +and each returned value should be the gradient w.r.t. the +corresponding input. If an input is not a Tensor or is a Tensor not +requiring grads, you can just pass None as a gradient for that input.

+

The context can be used to retrieve tensors saved during the forward +pass. It also has an attribute ctx.needs_input_grad as a tuple +of booleans representing whether each input needs gradient. E.g., +backward() will have ctx.needs_input_grad[0] = True if the +first input to forward() needs gradient computed w.r.t. the +output.

+
+ +
+
+static forward(self, x, y, memory, idx, params)
+

Define the forward of the custom autograd Function.

+

This function is to be overridden by all subclasses. +There are two ways to define forward:

+

Usage 1 (Combined forward and ctx):

+
@staticmethod
+def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any:
+    pass
+
+
+
    +
  • It must accept a context ctx as the first argument, followed by any +number of arguments (tensors or other types).

  • +
  • See combining-forward-context for more details

  • +
+

Usage 2 (Separate forward and ctx):

+
@staticmethod
+def forward(*args: Any, **kwargs: Any) -> Any:
+    pass
+
+@staticmethod
+def setup_context(ctx: Any, inputs: Tuple[Any, ...], output: Any) -> None:
+    pass
+
+
+
    +
  • The forward no longer accepts a ctx argument.

  • +
  • Instead, you must also override the torch.autograd.Function.setup_context() +staticmethod to handle setting up the ctx object. +output is the output of the forward, inputs are a Tuple of inputs +to the forward.

  • +
  • See extending-autograd for more details

  • +
+

The context can be used to store arbitrary data that can be then +retrieved during the backward pass. Tensors should not be stored +directly on ctx (though this is not currently enforced for +backward compatibility). Instead, tensors should be saved either with +ctx.save_for_backward() if they are intended to be used in +backward (equivalently, vjp) or ctx.save_for_forward() +if they are intended to be used for in jvp.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.rst new file mode 100644 index 0000000..785a30c --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.NCEAverage module +======================================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.html new file mode 100644 index 0000000..9ab2fa0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.NCECriterion(nLem)
+

Bases: Module

+
+
+forward(x, targets)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.rst new file mode 100644 index 0000000..3784936 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.NCECriterion module +========================================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.html new file mode 100644 index 0000000..6a2b081 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.html @@ -0,0 +1,158 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.AliasMethod(probs)
+

Bases: object

+

From: https://hips.seas.harvard.edu/blog/2013/03/03/the-alias-method-efficient-sampling-with-many-discrete-outcomes/

+
+
+cuda()
+
+ +
+
+draw(N)
+

Draw N samples from multinomial

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.rst new file mode 100644 index 0000000..ee64b99 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.alias\_multinomial module +=============================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.html new file mode 100644 index 0000000..33ae106 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.html @@ -0,0 +1,311 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.AddGaussianNoise(mean, sigma, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Add gaussian noise to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.AddGaussianPoissonNoise(sigma, peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Add poisson noise with gaussian blurred image to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.AddSpeckleNoise(mean, sigma, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Add speckle noise to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.BilinearResize(zoom)
+

Bases: object

+

Resize a PIL.Image or numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.CenterCropNumpy(size)
+

Bases: object

+

Crops the given numpy array at the center to have a region of +the given size. size can be a tuple (target_height, target_width) +or an integer, in which case the target will be of a square shape (size, size)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.ElasticTransform(alpha, sigma)
+

Bases: object

+

Apply elastic transformation on a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.EnhancedCompose(transforms)
+

Bases: object

+

Composes several transforms together. +Args:

+
+

transforms (List[Transform]): list of transforms to compose.

+
+
+
Example:
>>> transforms.Compose([
+>>>     transforms.CenterCrop(10),
+>>>     transforms.ToTensor(),
+>>> ])
+
+
+
+
+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.MaxScaleNumpy(range_min=0.0, range_max=1.0)
+

Bases: object

+

scale with max and min of each channel of the numpy array i.e. +channel = (channel - mean) / std

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.MedianScaleNumpy(range_min=0.0, range_max=1.0)
+

Bases: object

+

Scale with median and mean of each channel of the numpy array i.e. +channel = (channel - mean) / std

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.Merge(axis=-1)
+

Bases: object

+

Merge a group of images

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.MutualExclude(exclude_channel, from_channel)
+

Bases: object

+

Remove elements from one channel

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.NormalizeNumpy
+

Bases: object

+

Normalize each channel of the numpy array i.e. +channel = (channel - mean) / std

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.PoissonSubsampling(peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Poisson subsampling on a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.RandomCropNumpy(size, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Crops the given numpy array at a random location to have a region of +the given size. size can be a tuple (target_height, target_width) +or an integer, in which case the target will be of a square shape (size, size)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.RandomGaussianBlurring(sigma, p=0.2, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Apply gaussian blur to a numpy.ndarray (H x W x C)

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.RandomRotate(angle_range=(0.0, 360.0), axes=(0, 1), mode='reflect', random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Bases: object

+

Rotate a PIL.Image or numpy.ndarray (H x W x C) randomly

+
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.Split(*slices, **kwargs)
+

Bases: object

+

Split images into individual arrays

+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.center_crop(x, center_crop_size)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.elastic_transform(image, alpha=1000, sigma=30, spline_order=1, mode='nearest', random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+

Elastic deformation of image as described in [Simard2003]. +.. [Simard2003] Simard, Steinkraus and Platt, “Best Practices for

+
+

Convolutional Neural Networks applied to Visual Document Analysis”, in +Proc. of the International Conference on Document Analysis and +Recognition, 2003.

+
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.poisson_downsampling(image, peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.random_num_generator(config, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.to_tensor(x)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.rst new file mode 100644 index 0000000..bda852e --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.custom\_transforms module +=============================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.html new file mode 100644 index 0000000..1c36bd3 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.html @@ -0,0 +1,153 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.normalize.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.normalize.html new file mode 100644 index 0000000..2d31590 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.normalize.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.normalize module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.normalize module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.normalize.Normalize(power=2)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.normalize.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.normalize.rst new file mode 100644 index 0000000..0e8cda7 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.normalize.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.normalize module +====================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.normalize + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.rst new file mode 100644 index 0000000..309cd38 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.rst @@ -0,0 +1,21 @@ +brails.processors.FoundationClassifier.npid.npid\_lib package +============================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.npid.npid_lib.LinearAverage + brails.processors.FoundationClassifier.npid.npid_lib.NCEAverage + brails.processors.FoundationClassifier.npid.npid_lib.NCECriterion + brails.processors.FoundationClassifier.npid.npid_lib.alias_multinomial + brails.processors.FoundationClassifier.npid.npid_lib.custom_transforms + brails.processors.FoundationClassifier.npid.npid_lib.normalize + brails.processors.FoundationClassifier.npid.npid_lib.utils diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.utils.html new file mode 100644 index 0000000..56aae28 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.utils.html @@ -0,0 +1,157 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_lib.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_lib.utils module

+
+
+class brails.processors.FoundationClassifier.npid.npid_lib.utils.AverageMeter
+

Bases: object

+

Computes and stores the average and current value

+
+
+reset()
+
+ +
+
+update(val, n=1)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.utils.rst new file mode 100644 index 0000000..5a5b950 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_lib.utils.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_lib.utils module +================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_lib.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.html new file mode 100644 index 0000000..027ea0a --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.html @@ -0,0 +1,148 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_models package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_models package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet.html new file mode 100644 index 0000000..dae0c03 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet.html @@ -0,0 +1,210 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_models.resnet module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_models.resnet module

+
+
+class brails.processors.FoundationClassifier.npid.npid_models.resnet.ResNet(block, layers, low_dim=128)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet.resnet101(pretrained=False, **kwargs)
+

Constructs a ResNet-101 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet.resnet152(pretrained=False, **kwargs)
+

Constructs a ResNet-152 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet.resnet18(pretrained=False, **kwargs)
+

Constructs a ResNet-18 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet.resnet34(pretrained=False, **kwargs)
+

Constructs a ResNet-34 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet.resnet50(pretrained=False, **kwargs)
+

Constructs a ResNet-50 model.

+
+
Args:

pretrained (bool): If True, returns a model pre-trained on ImageNet

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet.rst new file mode 100644 index 0000000..eb27115 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_models.resnet module +====================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_models.resnet + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.html new file mode 100644 index 0000000..289b990 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.html @@ -0,0 +1,257 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar module

+

ResNet in PyTorch.

+

For Pre-activation ResNet, see ‘preact_resnet.py’.

+

Reference: +[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun

+
+

Deep Residual Learning for Image Recognition. arXiv:1512.03385

+
+
+
+class brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.BasicBlock(in_planes, planes, stride=1)
+

Bases: Module

+
+
+expansion = 1
+
+ +
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+training: bool
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.Bottleneck(in_planes, planes, stride=1)
+

Bases: Module

+
+
+expansion = 4
+
+ +
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+training: bool
+
+ +
+ +
+
+class brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.ResNet(block, num_blocks, low_dim=128)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.ResNet101(low_dim=128)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.ResNet152(low_dim=128)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.ResNet18(low_dim=128)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.ResNet34(low_dim=128)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.ResNet50(low_dim=128)
+
+ +
+
+brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.test()
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.rst new file mode 100644 index 0000000..0fa6b5b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_models.resnet\_cifar module +============================================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.rst new file mode 100644 index 0000000..b710f39 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_models.rst @@ -0,0 +1,16 @@ +brails.processors.FoundationClassifier.npid.npid\_models package +================================================================ + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_models + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.npid.npid_models.resnet + brails.processors.FoundationClassifier.npid.npid_models.resnet_cifar diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances.html new file mode 100644 index 0000000..ca798b9 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances.rst new file mode 100644 index 0000000..3c38bb8 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.npid\_toolbox.calculate\_all\_distances module +========================================================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.html new file mode 100644 index 0000000..38f9359 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.html @@ -0,0 +1,147 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.npid_toolbox package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.npid_toolbox package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.rst new file mode 100644 index 0000000..0071681 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.npid_toolbox.rst @@ -0,0 +1,15 @@ +brails.processors.FoundationClassifier.npid.npid\_toolbox package +================================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.npid_toolbox + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.npid.npid_toolbox.calculate_all_distances diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.rst new file mode 100644 index 0000000..aba303f --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.rst @@ -0,0 +1,29 @@ +brails.processors.FoundationClassifier.npid package +=================================================== + +.. automodule:: brails.processors.FoundationClassifier.npid + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.npid.npid_datasets + brails.processors.FoundationClassifier.npid.npid_lib + brails.processors.FoundationClassifier.npid.npid_models + brails.processors.FoundationClassifier.npid.npid_toolbox + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.npid.MDistance + brails.processors.FoundationClassifier.npid.cifar + brails.processors.FoundationClassifier.npid.main + brails.processors.FoundationClassifier.npid.test diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.test.html b/docs/rst-code/brails.processors.FoundationClassifier.npid.test.html new file mode 100644 index 0000000..97f0981 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.test.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.FoundationClassifier.npid.test module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.npid.test module

+
+
+brails.processors.FoundationClassifier.npid.test.NN(epoch, net, lemniscate, trainloader, testloader, recompute_memory=0)
+
+ +
+
+brails.processors.FoundationClassifier.npid.test.kNN(epoch, net, lemniscate, trainloader, testloader, K, sigma, recompute_memory=0)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.npid.test.rst b/docs/rst-code/brails.processors.FoundationClassifier.npid.test.rst new file mode 100644 index 0000000..c8d16fa --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.npid.test.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.npid.test module +======================================================= + +.. automodule:: brails.processors.FoundationClassifier.npid.test + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.rst b/docs/rst-code/brails.processors.FoundationClassifier.rst new file mode 100644 index 0000000..34e3a27 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.rst @@ -0,0 +1,31 @@ +brails.processors.FoundationClassifier package +============================================== + +.. automodule:: brails.processors.FoundationClassifier + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.attention_utils + brails.processors.FoundationClassifier.csail_segmentation_tool + brails.processors.FoundationClassifier.lib + brails.processors.FoundationClassifier.models + brails.processors.FoundationClassifier.npid + brails.processors.FoundationClassifier.utils + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.FoundationClassifier + brails.processors.FoundationClassifier.detect + brails.processors.FoundationClassifier.save_masked_images + brails.processors.FoundationClassifier.train diff --git a/docs/rst-code/brails.processors.FoundationClassifier.save_masked_images.html b/docs/rst-code/brails.processors.FoundationClassifier.save_masked_images.html new file mode 100644 index 0000000..b3bf2c0 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.save_masked_images.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.FoundationClassifier.save_masked_images module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.save_masked_images module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.save_masked_images.rst b/docs/rst-code/brails.processors.FoundationClassifier.save_masked_images.rst new file mode 100644 index 0000000..6d895b5 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.save_masked_images.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.save\_masked\_images module +================================================================== + +.. automodule:: brails.processors.FoundationClassifier.save_masked_images + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.train.html b/docs/rst-code/brails.processors.FoundationClassifier.train.html new file mode 100644 index 0000000..6070ad5 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.train.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.FoundationClassifier.train module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.train module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.train.rst b/docs/rst-code/brails.processors.FoundationClassifier.train.rst new file mode 100644 index 0000000..38e5380 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.train.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.train module +=================================================== + +.. automodule:: brails.processors.FoundationClassifier.train + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.utils.Datasets.html b/docs/rst-code/brails.processors.FoundationClassifier.utils.Datasets.html new file mode 100644 index 0000000..a65a5eb --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.utils.Datasets.html @@ -0,0 +1,169 @@ + + + + + + + + + brails.processors.FoundationClassifier.utils.Datasets module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.utils.Datasets module

+
+
+class brails.processors.FoundationClassifier.utils.Datasets.Foundation_Type_Binary(image_folder, transform=None, mask_buildings=False, load_masks=False)
+

Bases: Dataset

+
+ +
+
+class brails.processors.FoundationClassifier.utils.Datasets.Foundation_Type_Testset(image_folder, transform=None, mask_buildings=False, load_masks=False)
+

Bases: Dataset

+
+
+load_masks
+
+
if not os.path.isdir(image_folder):
+
if os.path.isfile(image_folder):

# The following format is to be consistent with os.walk output +file_list = [[os.path.split(image_folder)[0],’None’,[os.path.split(image_folder)[1]]]]

+
+
elif isinstance(image_folder, list): #a list of images

file_list = image_folder

+
+
else:

print(‘Error: Image folder or file {} not found.’.format(image_folder)) +exit()

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.utils.Datasets.rst b/docs/rst-code/brails.processors.FoundationClassifier.utils.Datasets.rst new file mode 100644 index 0000000..f06a7c6 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.utils.Datasets.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.utils.Datasets module +============================================================ + +.. automodule:: brails.processors.FoundationClassifier.utils.Datasets + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.utils.generate_csv.html b/docs/rst-code/brails.processors.FoundationClassifier.utils.generate_csv.html new file mode 100644 index 0000000..74bf9b9 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.utils.generate_csv.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.FoundationClassifier.utils.generate_csv module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.utils.generate_csv module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.utils.generate_csv.rst b/docs/rst-code/brails.processors.FoundationClassifier.utils.generate_csv.rst new file mode 100644 index 0000000..ebe4498 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.utils.generate_csv.rst @@ -0,0 +1,7 @@ +brails.processors.FoundationClassifier.utils.generate\_csv module +================================================================= + +.. automodule:: brails.processors.FoundationClassifier.utils.generate_csv + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.FoundationClassifier.utils.html b/docs/rst-code/brails.processors.FoundationClassifier.utils.html new file mode 100644 index 0000000..bd00fb8 --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.utils.html @@ -0,0 +1,147 @@ + + + + + + + + + brails.processors.FoundationClassifier.utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.FoundationClassifier.utils package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.FoundationClassifier.utils.rst b/docs/rst-code/brails.processors.FoundationClassifier.utils.rst new file mode 100644 index 0000000..3b12f2b --- /dev/null +++ b/docs/rst-code/brails.processors.FoundationClassifier.utils.rst @@ -0,0 +1,16 @@ +brails.processors.FoundationClassifier.utils package +==================================================== + +.. automodule:: brails.processors.FoundationClassifier.utils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier.utils.Datasets + brails.processors.FoundationClassifier.utils.generate_csv diff --git a/docs/rst-code/brails.processors.building_material_llm.building_material_llm.html b/docs/rst-code/brails.processors.building_material_llm.building_material_llm.html new file mode 100644 index 0000000..5ab7e09 --- /dev/null +++ b/docs/rst-code/brails.processors.building_material_llm.building_material_llm.html @@ -0,0 +1,150 @@ + + + + + + + + + brails.processors.building_material_llm.building_material_llm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.building_material_llm.building_material_llm module

+
+
+class brails.processors.building_material_llm.building_material_llm.BuildingMaterialLLM(input_dict: dict | None = None)
+

Bases: CLIPClassifier

+

The BuildingMaterialLLM classifier attempts to predict building materials using large language models.

+

Variables

+
+
Methods:

predict(ImageSet): To return the predictions for the set of images provided

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.building_material_llm.building_material_llm.rst b/docs/rst-code/brails.processors.building_material_llm.building_material_llm.rst new file mode 100644 index 0000000..75c94ad --- /dev/null +++ b/docs/rst-code/brails.processors.building_material_llm.building_material_llm.rst @@ -0,0 +1,7 @@ +brails.processors.building\_material\_llm.building\_material\_llm module +======================================================================== + +.. automodule:: brails.processors.building_material_llm.building_material_llm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.building_material_llm.html b/docs/rst-code/brails.processors.building_material_llm.html new file mode 100644 index 0000000..e013b27 --- /dev/null +++ b/docs/rst-code/brails.processors.building_material_llm.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.building_material_llm package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.building_material_llm package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.building_material_llm.rst b/docs/rst-code/brails.processors.building_material_llm.rst new file mode 100644 index 0000000..27e71e3 --- /dev/null +++ b/docs/rst-code/brails.processors.building_material_llm.rst @@ -0,0 +1,15 @@ +brails.processors.building\_material\_llm package +================================================= + +.. automodule:: brails.processors.building_material_llm + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.building_material_llm.building_material_llm diff --git a/docs/rst-code/brails.processors.cons_type_classifier.ConstructionTypeClassifier.html b/docs/rst-code/brails.processors.cons_type_classifier.ConstructionTypeClassifier.html new file mode 100644 index 0000000..a6a2d0a --- /dev/null +++ b/docs/rst-code/brails.processors.cons_type_classifier.ConstructionTypeClassifier.html @@ -0,0 +1,187 @@ + + + + + + + + + brails.processors.cons_type_classifier.ConstructionTypeClassifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.cons_type_classifier.ConstructionTypeClassifier module

+

Class object to use or create construction type classification models.

+
+
+class brails.processors.cons_type_classifier.ConstructionTypeClassifier.ConsTypeClassifier(model_path: str | None = None)
+

Bases: ImageClassifier

+

Class for facilitating classification of different construction types.

+

ConsTypeClassifier is a specialized class for classifying different +construction types (e.g., MAB, MAS, RCC, STL, WOD). It allows for making +predictions using a pre-trained model and retraining the pre-trained model +on new data. Inherits from the ImageClassifier class.

+

This class loads a default pre-trained model if a custom model path is not +provided during initialization. It can also be retrained using new +datasets.

+
+
+predict(data_dir: str) None
+

Perform construction type predictions on images in the specified path.

+
+
Args__
+
data_dir (str): Path to the directory containing images to be

classified.

+
+
+
+
+
+ +
+
+retrain(data_dir: str, batch_size: int = 8, nepochs: int = 100, plot_loss: bool = True) None
+

Retrain the construction type classifier on new data.

+
+
Args__

data_dir (str): Path to the directory containing training data. +batch_size (int, optional): Batch size for training. Default is 8. +nepochs (int, optional): Number of epochs for training. Default is

+
+
    +
  1. +
+
+
+
plot_loss (bool, optional): Whether to plot the loss during

training. Default is True.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.cons_type_classifier.ConstructionTypeClassifier.rst b/docs/rst-code/brails.processors.cons_type_classifier.ConstructionTypeClassifier.rst new file mode 100644 index 0000000..0d89337 --- /dev/null +++ b/docs/rst-code/brails.processors.cons_type_classifier.ConstructionTypeClassifier.rst @@ -0,0 +1,7 @@ +brails.processors.cons\_type\_classifier.ConstructionTypeClassifier module +========================================================================== + +.. automodule:: brails.processors.cons_type_classifier.ConstructionTypeClassifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.cons_type_classifier.html b/docs/rst-code/brails.processors.cons_type_classifier.html new file mode 100644 index 0000000..95d1906 --- /dev/null +++ b/docs/rst-code/brails.processors.cons_type_classifier.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.cons_type_classifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.cons_type_classifier package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.cons_type_classifier.rst b/docs/rst-code/brails.processors.cons_type_classifier.rst new file mode 100644 index 0000000..0d18de7 --- /dev/null +++ b/docs/rst-code/brails.processors.cons_type_classifier.rst @@ -0,0 +1,15 @@ +brails.processors.cons\_type\_classifier package +================================================ + +.. automodule:: brails.processors.cons_type_classifier + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.cons_type_classifier.ConstructionTypeClassifier diff --git a/docs/rst-code/brails.processors.facade_parser.facade_parser.html b/docs/rst-code/brails.processors.facade_parser.facade_parser.html new file mode 100644 index 0000000..1073e83 --- /dev/null +++ b/docs/rst-code/brails.processors.facade_parser.facade_parser.html @@ -0,0 +1,162 @@ + + + + + + + + + brails.processors.facade_parser.facade_parser module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.facade_parser.facade_parser module

+
+
+class brails.processors.facade_parser.facade_parser.FacadeParser(input_dict: dict | None = None)
+

Bases: ImageProcessor

+

The FacadeParser attempts to predict a whole unch of stuff

+

Variables

+
+
Methods:

predict(ImageSet): To return the predictions for the set of images provided

+
+
+
+
+predict(image: ImageSet)
+

The method predicts the stuff

+
+
Args

images: ImageSet The set of images for which a prediction is required

+
+
Return

dict: The keys being the same keys used in ImageSet.images, the values being a list containing the predictions

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.facade_parser.facade_parser.rst b/docs/rst-code/brails.processors.facade_parser.facade_parser.rst new file mode 100644 index 0000000..d78b6a6 --- /dev/null +++ b/docs/rst-code/brails.processors.facade_parser.facade_parser.rst @@ -0,0 +1,7 @@ +brails.processors.facade\_parser.facade\_parser module +====================================================== + +.. automodule:: brails.processors.facade_parser.facade_parser + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.facade_parser.html b/docs/rst-code/brails.processors.facade_parser.html new file mode 100644 index 0000000..d10e1dd --- /dev/null +++ b/docs/rst-code/brails.processors.facade_parser.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.facade_parser package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.facade_parser package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.facade_parser.rst b/docs/rst-code/brails.processors.facade_parser.rst new file mode 100644 index 0000000..b6c65fe --- /dev/null +++ b/docs/rst-code/brails.processors.facade_parser.rst @@ -0,0 +1,15 @@ +brails.processors.facade\_parser package +======================================== + +.. automodule:: brails.processors.facade_parser + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.facade_parser.facade_parser diff --git a/docs/rst-code/brails.processors.garage_detector.garage_detector.html b/docs/rst-code/brails.processors.garage_detector.garage_detector.html new file mode 100644 index 0000000..f4e1b6c --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.garage_detector.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.garage_detector.garage_detector module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.garage_detector module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.garage_detector.rst b/docs/rst-code/brails.processors.garage_detector.garage_detector.rst new file mode 100644 index 0000000..be491da --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.garage_detector.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.garage\_detector module +========================================================== + +.. automodule:: brails.processors.garage_detector.garage_detector + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.html b/docs/rst-code/brails.processors.garage_detector.html new file mode 100644 index 0000000..6950203 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.html @@ -0,0 +1,155 @@ + + + + + + + + + brails.processors.garage_detector package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.backbone.html b/docs/rst-code/brails.processors.garage_detector.lib.backbone.html new file mode 100644 index 0000000..fcedd5d --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.backbone.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.garage_detector.lib.backbone module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.backbone module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.backbone.rst b/docs/rst-code/brails.processors.garage_detector.lib.backbone.rst new file mode 100644 index 0000000..19ab88e --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.backbone.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.backbone module +====================================================== + +.. automodule:: brails.processors.garage_detector.lib.backbone + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.coco.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.coco.html new file mode 100644 index 0000000..37d8518 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.coco.html @@ -0,0 +1,218 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet.coco module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientdet.coco module

+
+
+class brails.processors.garage_detector.lib.efficientdet.coco.COCO(annotation_file=None)
+

Bases: object

+
+
+createIndex()
+
+ +
+
+getAnnIds(imgIds=[], catIds=[], areaRng=[], iscrowd=None)
+

Get ann ids that satisfy given filter conditions. default skips that filter +:param imgIds (int array) : get anns for given imgs

+
+

catIds (int array) : get anns for given cats +areaRng (float array) : get anns for given area range (e.g. [0 inf]) +iscrowd (boolean) : get anns for given crowd label (False or True)

+
+
+
Returns:
+

ids (int array) : integer array of ann ids

+
+
+
+ +
+
+getCatIds(catNms=[], supNms=[], catIds=[])
+

filtering parameters. default skips that filter. +:param catNms (str array) : get cats for given cat names +:param supNms (str array) : get cats for given supercategory names +:param catIds (int array) : get cats for given cat ids +:return: ids (int array) : integer array of cat ids

+
+ +
+
+getImgIds(imgIds=[], catIds=[])
+

Get img ids that satisfy given filter conditions. +:param imgIds (int array) : get imgs for given ids +:param catIds (int array) : get imgs with all given cats +:return: ids (int array) : integer array of img ids

+
+ +
+
+info()
+

Print information about the annotation file. +:return:

+
+ +
+
+loadAnns(ids=[])
+

Load anns with the specified ids. +:param ids (int array) : integer ids specifying anns +:return: anns (object array) : loaded ann objects

+
+ +
+
+loadCats(ids=[])
+

Load cats with the specified ids. +:param ids (int array) : integer ids specifying cats +:return: cats (object array) : loaded cat objects

+
+ +
+
+loadImgs(ids=[])
+

Load anns with the specified ids. +:param ids (int array) : integer ids specifying img +:return: imgs (object array) : loaded img objects

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.coco.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.coco.rst new file mode 100644 index 0000000..edfb101 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.coco.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientdet.coco module +=============================================================== + +.. automodule:: brails.processors.garage_detector.lib.efficientdet.coco + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.config.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.config.html new file mode 100644 index 0000000..8c0035b --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.config.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet.config module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientdet.config module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.config.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.config.rst new file mode 100644 index 0000000..6e9d913 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.config.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientdet.config module +================================================================= + +.. automodule:: brails.processors.garage_detector.lib.efficientdet.config + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.dataset.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.dataset.html new file mode 100644 index 0000000..e4d23e4 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.dataset.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet.dataset module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientdet.dataset module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.dataset.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.dataset.rst new file mode 100644 index 0000000..d110508 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.dataset.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientdet.dataset module +================================================================== + +.. automodule:: brails.processors.garage_detector.lib.efficientdet.dataset + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.html new file mode 100644 index 0000000..aae1e12 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.loss.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.loss.html new file mode 100644 index 0000000..ff9eb97 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.loss.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet.loss module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientdet.loss module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.loss.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.loss.rst new file mode 100644 index 0000000..cbd7b29 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.loss.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientdet.loss module +=============================================================== + +.. automodule:: brails.processors.garage_detector.lib.efficientdet.loss + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.model.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.model.html new file mode 100644 index 0000000..5a6f083 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.model.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet.model module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientdet.model module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.model.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.model.rst new file mode 100644 index 0000000..6c0036f --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.model.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientdet.model module +================================================================ + +.. automodule:: brails.processors.garage_detector.lib.efficientdet.model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.rst new file mode 100644 index 0000000..5fd1621 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.rst @@ -0,0 +1,20 @@ +brails.processors.garage\_detector.lib.efficientdet package +=========================================================== + +.. automodule:: brails.processors.garage_detector.lib.efficientdet + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.efficientdet.coco + brails.processors.garage_detector.lib.efficientdet.config + brails.processors.garage_detector.lib.efficientdet.dataset + brails.processors.garage_detector.lib.efficientdet.loss + brails.processors.garage_detector.lib.efficientdet.model + brails.processors.garage_detector.lib.efficientdet.utils diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.utils.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.utils.html new file mode 100644 index 0000000..a2a105f --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.utils.html @@ -0,0 +1,210 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientdet.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientdet.utils module

+
+
+class brails.processors.garage_detector.lib.efficientdet.utils.Anchors(anchor_scale=4.0, pyramid_levels=None, **kwargs)
+

Bases: Module

+

adapted and modified from https://github.com/google/automl/blob/master/efficientdet/anchors.py by Zylo117

+
+
+forward(image, dtype=torch.float32)
+

Generates multiscale anchor boxes.

+
+
Args:
+
image_size: integer number of input image size. The input image has the

same dimension for width and height. The image_size should be divided by +the largest feature stride 2^max_level.

+
+
anchor_scale: float number representing the scale of size of the base

anchor to the feature stride 2^level.

+
+
anchor_configs: a dictionary with keys as the levels of anchors and

values as a list of anchor configuration.

+
+
+
+
Returns:
+
anchor_boxes: a numpy array with shape [N, 4], which stacks anchors on all

feature levels.

+
+
+
+
Raises:

ValueError: input size must be the multiple of largest feature stride.

+
+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientdet.utils.BBoxTransform(*args, **kwargs)
+

Bases: Module

+
+
+forward(anchors, regression)
+

decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py

+
+
Args:

anchors: [batchsize, boxes, (y1, x1, y2, x2)] +regression: [batchsize, boxes, (dy, dx, dh, dw)]

+
+
+

Returns:

+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientdet.utils.ClipBoxes
+

Bases: Module

+
+
+forward(boxes, img)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.utils.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.utils.rst new file mode 100644 index 0000000..0a534a1 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientdet.utils.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientdet.utils module +================================================================ + +.. automodule:: brails.processors.garage_detector.lib.efficientdet.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.html new file mode 100644 index 0000000..0c5b939 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientnet package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.model.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.model.html new file mode 100644 index 0000000..72d8228 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.model.html @@ -0,0 +1,223 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientnet.model module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientnet.model module

+
+
+class brails.processors.garage_detector.lib.efficientnet.model.EfficientNet(blocks_args=None, global_params=None)
+

Bases: Module

+

An EfficientNet model. Most easily loaded with the .from_name or .from_pretrained methods

+
+
Args:

blocks_args (list): A list of BlockArgs to construct blocks +global_params (namedtuple): A set of GlobalParams shared between blocks

+
+
Example:

model = EfficientNet.from_pretrained(‘efficientnet-b0’)

+
+
+
+
+extract_features(inputs)
+

Returns output of the final convolution layer

+
+ +
+
+forward(inputs)
+

Calls extract_features to extract features, applies final linear layer, and returns logits.

+
+ +
+
+classmethod from_name(model_name, override_params=None)
+
+ +
+
+classmethod from_pretrained(model_name, load_weights=True, advprop=False, num_classes=1000, in_channels=3)
+
+ +
+
+classmethod get_image_size(model_name)
+
+ +
+
+set_swish(memory_efficient=True)
+

Sets swish function as memory efficient (for training) or standard (for export)

+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.model.MBConvBlock(block_args, global_params)
+

Bases: Module

+

Mobile Inverted Residual Bottleneck Block

+
+
Args:

block_args (namedtuple): BlockArgs, see above +global_params (namedtuple): GlobalParam, see above

+
+
Attributes:

has_se (bool): Whether the block contains a Squeeze and Excitation layer.

+
+
+
+
+forward(inputs, drop_connect_rate=None)
+
+
Parameters:
+
    +
  • inputs – input tensor

  • +
  • drop_connect_rate – drop connect rate (float, between 0 and 1)

  • +
+
+
Returns:
+

output of block

+
+
+
+ +
+
+set_swish(memory_efficient=True)
+

Sets swish function as memory efficient (for training) or standard (for export)

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.model.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.model.rst new file mode 100644 index 0000000..3614626 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.model.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientnet.model module +================================================================ + +.. automodule:: brails.processors.garage_detector.lib.efficientnet.model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.rst new file mode 100644 index 0000000..95b8139 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.rst @@ -0,0 +1,17 @@ +brails.processors.garage\_detector.lib.efficientnet package +=========================================================== + +.. automodule:: brails.processors.garage_detector.lib.efficientnet + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.efficientnet.model + brails.processors.garage_detector.lib.efficientnet.utils + brails.processors.garage_detector.lib.efficientnet.utils_extra diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils.html new file mode 100644 index 0000000..d9666ed --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils.html @@ -0,0 +1,499 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientnet.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientnet.utils module

+

This file contains helper functions for building the model and for loading model parameters. +These helper functions are built to mirror those in the official TensorFlow implementation.

+
+
+class brails.processors.garage_detector.lib.efficientnet.utils.BlockArgs(kernel_size, num_repeat, input_filters, output_filters, expand_ratio, id_skip, stride, se_ratio)
+

Bases: tuple

+
+
+expand_ratio
+

Alias for field number 4

+
+ +
+
+id_skip
+

Alias for field number 5

+
+ +
+
+input_filters
+

Alias for field number 2

+
+ +
+
+kernel_size
+

Alias for field number 0

+
+ +
+
+num_repeat
+

Alias for field number 1

+
+ +
+
+output_filters
+

Alias for field number 3

+
+ +
+
+se_ratio
+

Alias for field number 7

+
+ +
+
+stride
+

Alias for field number 6

+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.BlockDecoder
+

Bases: object

+

Block Decoder for readability, straight from the official TensorFlow repository

+
+
+static decode(string_list)
+

Decodes a list of string notations to specify blocks inside the network.

+
+
Parameters:
+

string_list – a list of strings, each string is a notation of block

+
+
Returns:
+

a list of BlockArgs namedtuples of block args

+
+
+
+ +
+
+static encode(blocks_args)
+

Encodes a list of BlockArgs to a list of strings.

+
+
Parameters:
+

blocks_args – a list of BlockArgs namedtuples of block args

+
+
Returns:
+

a list of strings, each string is a notation of block

+
+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.Conv2dDynamicSamePadding(in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1, bias=True)
+

Bases: Conv2d

+

2D Convolutions like TensorFlow, for a dynamic image size

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.GlobalParams(batch_norm_momentum, batch_norm_epsilon, dropout_rate, num_classes, width_coefficient, depth_coefficient, depth_divisor, min_depth, drop_connect_rate, image_size)
+

Bases: tuple

+
+
+batch_norm_epsilon
+

Alias for field number 1

+
+ +
+
+batch_norm_momentum
+

Alias for field number 0

+
+ +
+
+depth_coefficient
+

Alias for field number 5

+
+ +
+
+depth_divisor
+

Alias for field number 6

+
+ +
+
+drop_connect_rate
+

Alias for field number 8

+
+ +
+
+dropout_rate
+

Alias for field number 2

+
+ +
+
+image_size
+

Alias for field number 9

+
+ +
+
+min_depth
+

Alias for field number 7

+
+ +
+
+num_classes
+

Alias for field number 3

+
+ +
+
+width_coefficient
+

Alias for field number 4

+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.Identity
+

Bases: Module

+
+
+forward(input)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.MemoryEfficientSwish(*args, **kwargs)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.Swish(*args, **kwargs)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils.SwishImplementation(*args, **kwargs)
+

Bases: Function

+
+
+static backward(ctx, grad_output)
+

Define a formula for differentiating the operation with backward mode automatic differentiation.

+

This function is to be overridden by all subclasses. +(Defining this function is equivalent to defining the vjp function.)

+

It must accept a context ctx as the first argument, followed by +as many outputs as the forward() returned (None will be passed in +for non tensor outputs of the forward function), +and it should return as many tensors, as there were inputs to +forward(). Each argument is the gradient w.r.t the given output, +and each returned value should be the gradient w.r.t. the +corresponding input. If an input is not a Tensor or is a Tensor not +requiring grads, you can just pass None as a gradient for that input.

+

The context can be used to retrieve tensors saved during the forward +pass. It also has an attribute ctx.needs_input_grad as a tuple +of booleans representing whether each input needs gradient. E.g., +backward() will have ctx.needs_input_grad[0] = True if the +first input to forward() needs gradient computed w.r.t. the +output.

+
+ +
+
+static forward(ctx, i)
+

Define the forward of the custom autograd Function.

+

This function is to be overridden by all subclasses. +There are two ways to define forward:

+

Usage 1 (Combined forward and ctx):

+
@staticmethod
+def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any:
+    pass
+
+
+
    +
  • It must accept a context ctx as the first argument, followed by any +number of arguments (tensors or other types).

  • +
  • See combining-forward-context for more details

  • +
+

Usage 2 (Separate forward and ctx):

+
@staticmethod
+def forward(*args: Any, **kwargs: Any) -> Any:
+    pass
+
+@staticmethod
+def setup_context(ctx: Any, inputs: Tuple[Any, ...], output: Any) -> None:
+    pass
+
+
+
    +
  • The forward no longer accepts a ctx argument.

  • +
  • Instead, you must also override the torch.autograd.Function.setup_context() +staticmethod to handle setting up the ctx object. +output is the output of the forward, inputs are a Tuple of inputs +to the forward.

  • +
  • See extending-autograd for more details

  • +
+

The context can be used to store arbitrary data that can be then +retrieved during the backward pass. Tensors should not be stored +directly on ctx (though this is not currently enforced for +backward compatibility). Instead, tensors should be saved either with +ctx.save_for_backward() if they are intended to be used in +backward (equivalently, vjp) or ctx.save_for_forward() +if they are intended to be used for in jvp.

+
+ +
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.drop_connect(inputs, p, training)
+

Drop connect.

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.efficientnet(width_coefficient=None, depth_coefficient=None, dropout_rate=0.2, drop_connect_rate=0.2, image_size=None, num_classes=1000)
+

Creates a efficientnet model.

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.efficientnet_params(model_name)
+

Map EfficientNet model name to parameter coefficients.

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.get_model_params(model_name, override_params)
+

Get the block args and global params for a given model

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.get_same_padding_conv2d(image_size=None)
+

Chooses static padding if you have specified an image size, and dynamic padding otherwise. +Static padding is necessary for ONNX exporting of models.

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.load_pretrained_weights(model, model_name, load_fc=True, advprop=False)
+

Loads pretrained weights, and downloads if loading for the first time.

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.round_filters(filters, global_params)
+

Calculate and round number of filters based on depth multiplier.

+
+ +
+
+brails.processors.garage_detector.lib.efficientnet.utils.round_repeats(repeats, global_params)
+

Round number of filters based on depth multiplier.

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils.rst new file mode 100644 index 0000000..52566ca --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientnet.utils module +================================================================ + +.. automodule:: brails.processors.garage_detector.lib.efficientnet.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils_extra.html b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils_extra.html new file mode 100644 index 0000000..564750f --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils_extra.html @@ -0,0 +1,184 @@ + + + + + + + + + brails.processors.garage_detector.lib.efficientnet.utils_extra module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.efficientnet.utils_extra module

+
+
+class brails.processors.garage_detector.lib.efficientnet.utils_extra.Conv2dStaticSamePadding(in_channels, out_channels, kernel_size, stride=1, bias=True, groups=1, dilation=1, **kwargs)
+

Bases: Module

+

created by Zylo117 +The real keras/tensorflow conv2d with same padding

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.efficientnet.utils_extra.MaxPool2dStaticSamePadding(*args, **kwargs)
+

Bases: Module

+

created by Zylo117 +The real keras/tensorflow MaxPool2d with same padding

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils_extra.rst b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils_extra.rst new file mode 100644 index 0000000..6db4ec3 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.efficientnet.utils_extra.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.efficientnet.utils\_extra module +======================================================================= + +.. automodule:: brails.processors.garage_detector.lib.efficientnet.utils_extra + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.html b/docs/rst-code/brails.processors.garage_detector.lib.html new file mode 100644 index 0000000..47b0b91 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.garage_detector.lib package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.infer_detector.html b/docs/rst-code/brails.processors.garage_detector.lib.infer_detector.html new file mode 100644 index 0000000..9dac1a4 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.infer_detector.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.garage_detector.lib.infer_detector module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.infer_detector module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.infer_detector.rst b/docs/rst-code/brails.processors.garage_detector.lib.infer_detector.rst new file mode 100644 index 0000000..e96c139 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.infer_detector.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.infer\_detector module +============================================================= + +.. automodule:: brails.processors.garage_detector.lib.infer_detector + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.rst b/docs/rst-code/brails.processors.garage_detector.lib.rst new file mode 100644 index 0000000..aade968 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.rst @@ -0,0 +1,27 @@ +brails.processors.garage\_detector.lib package +============================================== + +.. automodule:: brails.processors.garage_detector.lib + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.efficientdet + brails.processors.garage_detector.lib.efficientnet + brails.processors.garage_detector.lib.utils + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.backbone + brails.processors.garage_detector.lib.infer_detector + brails.processors.garage_detector.lib.train_detector diff --git a/docs/rst-code/brails.processors.garage_detector.lib.train_detector.html b/docs/rst-code/brails.processors.garage_detector.lib.train_detector.html new file mode 100644 index 0000000..ce512b2 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.train_detector.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.garage_detector.lib.train_detector module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.train_detector module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.train_detector.rst b/docs/rst-code/brails.processors.garage_detector.lib.train_detector.rst new file mode 100644 index 0000000..d1f657f --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.train_detector.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.train\_detector module +============================================================= + +.. automodule:: brails.processors.garage_detector.lib.train_detector + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.html new file mode 100644 index 0000000..b8f569a --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.html @@ -0,0 +1,157 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.rst new file mode 100644 index 0000000..121fad0 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.rst @@ -0,0 +1,23 @@ +brails.processors.garage\_detector.lib.utils package +==================================================== + +.. automodule:: brails.processors.garage_detector.lib.utils + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.utils.sync_batchnorm + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.utils.utils diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.html new file mode 100644 index 0000000..a6ff9e1 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.html @@ -0,0 +1,336 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm module

+
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.SynchronizedBatchNorm1d(num_features, eps=1e-05, momentum=0.1, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Synchronized Batch Normalization over a 2d or 3d input that is seen as a +mini-batch.

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm1d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, L) slices, it’s common terminology to call this Temporal BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of size

batch_size x num_features [x width]

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape::
    +
  • Input: \((N, C)\) or \((N, C, L)\)

  • +
  • Output: \((N, C)\) or \((N, C, L)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm1d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm1d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.SynchronizedBatchNorm2d(num_features, eps=1e-05, momentum=0.1, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Batch Normalization over a 4d input that is seen as a mini-batch +of 3d inputs

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm2d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, H, W) slices, it’s common terminology to call this Spatial BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of

size batch_size x num_features x height x width

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape::
    +
  • Input: \((N, C, H, W)\)

  • +
  • Output: \((N, C, H, W)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm2d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm2d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100, 35, 45))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.SynchronizedBatchNorm3d(num_features, eps=1e-05, momentum=0.1, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Batch Normalization over a 5d input that is seen as a mini-batch +of 4d inputs

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm3d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, D, H, W) slices, it’s common terminology to call this Volumetric BatchNorm +or Spatio-temporal BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of

size batch_size x num_features x depth x height x width

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape::
    +
  • Input: \((N, C, D, H, W)\)

  • +
  • Output: \((N, C, D, H, W)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm3d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm3d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100, 35, 45, 10))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.convert_model(module)
+
+
Traverse the input module and its child recursively

and replace all instance of torch.nn.modules.batchnorm.BatchNorm*N*d +to SynchronizedBatchNorm*N*d

+
+
Args:

module: the input module needs to be convert to SyncBN model

+
+
Examples:
>>> import torch.nn as nn
+>>> import torchvision
+>>> # m is a standard pytorch model
+>>> m = torchvision.models.resnet18(True)
+>>> m = nn.DataParallel(m)
+>>> # after convert, m is using SyncBN
+>>> m = convert_model(m)
+
+
+
+
+
+ +
+
+brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.patch_sync_batchnorm()
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.rst new file mode 100644 index 0000000..2af2f44 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.utils.sync\_batchnorm.batchnorm module +============================================================================= + +.. automodule:: brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.html new file mode 100644 index 0000000..535a59d --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.html @@ -0,0 +1,176 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl module

+
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.BatchNorm2dReimpl(num_features, eps=1e-05, momentum=0.1)
+

Bases: Module

+

A re-implementation of batch normalization, used for testing the numerical +stability.

+

Author: acgtyrant +See also: +https://github.com/vacancy/Synchronized-BatchNorm-PyTorch/issues/14

+
+
+forward(input_)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+reset_parameters()
+
+ +
+
+reset_running_stats()
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.rst new file mode 100644 index 0000000..b915e92 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.utils.sync\_batchnorm.batchnorm\_reimpl module +===================================================================================== + +.. automodule:: brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.html new file mode 100644 index 0000000..39252a5 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.html @@ -0,0 +1,216 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.sync_batchnorm.comm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils.sync_batchnorm.comm module

+
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.FutureResult
+

Bases: object

+

A thread-safe future implementation. Used only as one-to-one pipe.

+
+
+get()
+
+ +
+
+put(result)
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.SlavePipe(identifier, queue, result)
+

Bases: _SlavePipeBase

+

Pipe for master-slave communication.

+
+
+run_slave(msg)
+
+ +
+ +
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.SyncMaster(master_callback)
+

Bases: object

+

An abstract SyncMaster object.

+
    +
  • During the replication, as the data parallel will trigger an callback of each module, all slave devices should

  • +
+

call register(id) and obtain an SlavePipe to communicate with the master. +- During the forward pass, master device invokes run_master, all messages from slave devices will be collected, +and passed to a registered callback. +- After receiving the messages, the master device should gather the information and determine to message passed +back to each slave devices.

+
+
+property nr_slaves
+
+ +
+
+register_slave(identifier)
+

Register an slave device.

+
+
Args:

identifier: an identifier, usually is the device id.

+
+
+

Returns: a SlavePipe object which can be used to communicate with the master device.

+
+ +
+
+run_master(master_msg)
+

Main entry for the master device in each forward pass. +The messages were first collected from each devices (including the master device), and then +an callback will be invoked to compute the message to be sent back to each devices +(including the master device).

+
+
Args:

master_msg: the message that the master want to send to itself. This will be placed as the first +message when calling master_callback. For detailed usage, see _SynchronizedBatchNorm for an example.

+
+
+

Returns: the message to be sent back to the master device.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.rst new file mode 100644 index 0000000..7f53d1e --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.comm.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.utils.sync\_batchnorm.comm module +======================================================================== + +.. automodule:: brails.processors.garage_detector.lib.utils.sync_batchnorm.comm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.html new file mode 100644 index 0000000..160b6fa --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.html @@ -0,0 +1,154 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.sync_batchnorm package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.html new file mode 100644 index 0000000..6a1ad7c --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.html @@ -0,0 +1,196 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate module

+
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.CallbackContext
+

Bases: object

+
+ +
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.DataParallelWithCallback(module: T, device_ids: Sequence[int | device] | None = None, output_device: int | device | None = None, dim: int = 0)
+

Bases: DataParallel

+

Data Parallel with a replication callback.

+

An replication callback __data_parallel_replicate__ of each module will be invoked after being created by +original replicate function. +The callback will be invoked with arguments __data_parallel_replicate__(ctx, copy_id)

+
+
Examples:

> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1]) +# sync_bn.__data_parallel_replicate__ will be invoked.

+
+
+
+
+replicate(module, device_ids)
+
+ +
+ +
+
+brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.execute_replication_callbacks(modules)
+

Execute an replication callback __data_parallel_replicate__ on each module created by original replication.

+

The callback will be invoked with arguments __data_parallel_replicate__(ctx, copy_id)

+

Note that, as all modules are isomorphism, we assign each sub-module with a context +(shared among multiple copies of this module on different devices). +Through this context, different copies can share some information.

+

We guarantee that the callback on the master copy (the first copy) will be called ahead of calling the callback +of any slave copies.

+
+ +
+
+brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.patch_replication_callback(data_parallel)
+

Monkey-patch an existing DataParallel object. Add the replication callback. +Useful when you have customized DataParallel implementation.

+
+
Examples:

> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallel(sync_bn, device_ids=[0, 1]) +> patch_replication_callback(sync_bn) +# this is equivalent to +> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1])

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.rst new file mode 100644 index 0000000..ad0f0be --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.utils.sync\_batchnorm.replicate module +============================================================================= + +.. automodule:: brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.rst new file mode 100644 index 0000000..b560a50 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.rst @@ -0,0 +1,19 @@ +brails.processors.garage\_detector.lib.utils.sync\_batchnorm package +==================================================================== + +.. automodule:: brails.processors.garage_detector.lib.utils.sync_batchnorm + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm + brails.processors.garage_detector.lib.utils.sync_batchnorm.batchnorm_reimpl + brails.processors.garage_detector.lib.utils.sync_batchnorm.comm + brails.processors.garage_detector.lib.utils.sync_batchnorm.replicate + brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.html new file mode 100644 index 0000000..8fed190 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest module

+
+
+class brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.TorchTestCase(methodName='runTest')
+

Bases: TestCase

+
+
+assertTensorClose(x, y)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.rst new file mode 100644 index 0000000..0bffe26 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.utils.sync\_batchnorm.unittest module +============================================================================ + +.. automodule:: brails.processors.garage_detector.lib.utils.sync_batchnorm.unittest + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.utils.html b/docs/rst-code/brails.processors.garage_detector.lib.utils.utils.html new file mode 100644 index 0000000..dc97c10 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.utils.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.garage_detector.lib.utils.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.garage_detector.lib.utils.utils module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.garage_detector.lib.utils.utils.rst b/docs/rst-code/brails.processors.garage_detector.lib.utils.utils.rst new file mode 100644 index 0000000..86ed1c0 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.lib.utils.utils.rst @@ -0,0 +1,7 @@ +brails.processors.garage\_detector.lib.utils.utils module +========================================================= + +.. automodule:: brails.processors.garage_detector.lib.utils.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.garage_detector.rst b/docs/rst-code/brails.processors.garage_detector.rst new file mode 100644 index 0000000..f127871 --- /dev/null +++ b/docs/rst-code/brails.processors.garage_detector.rst @@ -0,0 +1,23 @@ +brails.processors.garage\_detector package +========================================== + +.. automodule:: brails.processors.garage_detector + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.lib + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.garage_detector.garage_detector diff --git a/docs/rst-code/brails.processors.html b/docs/rst-code/brails.processors.html new file mode 100644 index 0000000..6f9a4f7 --- /dev/null +++ b/docs/rst-code/brails.processors.html @@ -0,0 +1,171 @@ + + + + + + + + + brails.processors package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.image_classifier.html b/docs/rst-code/brails.processors.image_classifier.html new file mode 100644 index 0000000..6c1f4c1 --- /dev/null +++ b/docs/rst-code/brails.processors.image_classifier.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.image_classifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.image_classifier package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.image_classifier.image_classifier.html b/docs/rst-code/brails.processors.image_classifier.image_classifier.html new file mode 100644 index 0000000..dfb7223 --- /dev/null +++ b/docs/rst-code/brails.processors.image_classifier.image_classifier.html @@ -0,0 +1,331 @@ + + + + + + + + + brails.processors.image_classifier.image_classifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.image_classifier.image_classifier module

+

Class object to train and use image classification models.

+
+
+class brails.processors.image_classifier.image_classifier.ImageClassifier
+

Bases: object

+

A class to manage and train an image classification model.

+

This class provides methods to download train models using transfer +learning, retrain existing models, and make predictions using these models. +The class supports using different model architectures and performs +operations on GPU if available.

+

Attributes__ +- device (torch.device): The device (GPU or CPU) on which the model will be

+
+

trained and evaluated.

+
+
    +
  • +
    implemented_architectures (List[str]): List of supported model

    architectures.

    +
    +
    +
  • +
+
+
+predict(images: ImageSet, model_arch: str = 'efficientnetv2_s', model_path: str = 'tmp/models/trained_model.pth', classes: List[str] = ['Ants', 'Bees']) Dict[str, str]
+

Predict the class of each image in the provided image set.

+
+
Args__
+
images (ImageSet): An object containing the directory path and

image data.

+
+
model_arch (str): The architecture of the model to be used for

prediction.

+
+
model_path (str, optional): Path to the pre-trained model. Defaults

to ‘tmp/models/trained_model.pth’.

+
+
classes (List[str], optional): List of class labels. Defaults to

[‘Ants’, ‘Bees’].

+
+
+
+
Raises__
+
NotImplementedError: If the specified model architecture is not

found in MODEL_PROPERTIES.

+
+
NotADirectoryError: If the directory containing the images is not

valid.

+
+
+
+
Returns__
+
Dict[str, str]: A dictionary where the keys are image names and

the values are the predicted classes.

+
+
+
+
+
+ +
+
+retrain(model_arch: str = 'efficientnetv2_s', model_path: str = 'tmp/models/trained_model.pth', train_data_dir: str = 'tmp/hymenoptera_data', batch_size: int = 32, nepochs: int | List[int] = 100, es_tolerance: int = 10, plot_accuracy: bool = True) None
+

Retrain existing model using training dataset and hyperparameters.

+

Parameters__ +- model_path (str): Path to the pre-trained model to be fine-tuned.

+
+

Default is ‘tmp/models/trained_model.pth’.

+
+
    +
  • +
    train_data_dir (str): Directory containing the training and

    validation datasets. Default is ‘tmp/hymenoptera_data’.

    +
    +
    +
  • +
  • +
    model_inp_size (int): Input size for the model, used for resizing

    images in the dataset. Default is 384.

    +
    +
    +
  • +
  • batch_size (int): Batch size for data loading. Default is 32.

  • +
  • +
    nepochs (Union[int, List[int]]): Number of epochs for training.

    Should be an integer for retraining. Default is 100.

    +
    +
    +
  • +
  • +
    es_tolerance (int): Early stopping tolerance; the number of epochs

    without improvement before stopping. Default is 10.

    +
    +
    +
  • +
  • +
    plot_accuracy (bool): Whether to plot the validation accuracy over

    epochs. Default is True.

    +
    +
    +
  • +
+

Returns__ +- None

+

Raises__ +- ValueError: If nepochs is not provided as an integer during

+
+

retraining.

+
+

Procedure__ +1. Loads the model from the specified path. +2. Applies data augmentation and normalization to the training dataset

+
+

and normalization to the validation dataset.

+
+
    +
  1. +
    If the default training data directory is used, downloads a sample

    dataset.

    +
    +
    +
  2. +
  3. +
    Prepares PyTorch DataLoader objects for the training and

    validation datasets.

    +
    +
    +
  4. +
  5. +
    Sends the model to the GPU and fine-tunes it using Stochastic

    Gradient Descent (SGD) optimization.

    +
    +
    +
  6. +
  7. After training, the model is saved at the specified path.

  8. +
  9. +
    If plot_accuracy is True, plots the validation accuracy versus

    training epochs.

    +
    +
    +
  10. +
+

Example__ +>>> classifier = ImageClassifier() +>>> classifier.retrain(model_path=’model.pth’,

+
+

train_data_dir=’my_data’, +nepochs=50)

+
+
+ +
+
+train(model_arch: str = 'efficientnetv2_s', train_data_dir: str = 'tmp/hymenoptera_data', batch_size: int = 32, nepochs: int | List[int] = 100, es_tolerance: int = 10, plot_accuracy: bool = True) None
+

Train a model using transfer learning.

+

Parameters__ +- model_arch (str): The architecture of the model to use

+
+

(e.g., ‘efficientnetv2_s’).

+
+
    +
  • +
    train_data_dir (str): The directory where the training and validation

    data is located.

    +
    +
    +
  • +
  • batch_size (int): The number of samples per batch.

  • +
  • +
    nepochs (Union[int, List[int]]): Number of epochs for initial

    training and fine-tuning. +If an integer, it will be split into two halves for initial +training and fine-tuning. +If a list of two integers, it will use the two values as epochs for +initial training and fine-tuning respectively.

    +
    +
    +
  • +
  • +
    es_tolerance (int): Number of epochs with no improvement after which

    training will be stopped early.

    +
    +
    +
  • +
  • +
    plot_accuracy (bool): Whether to plot the validation accuracy

    against the number of training epochs.

    +
    +
    +
  • +
+

Returns__ +- None: This method does not return any value.

+

Raises__ +- ValueError: If nepochs is not an integer or a list of two integers. +- NotImplementedError: model_arch is not defined

+

Example__ +>>> trainer = ImageClassifier() +>>> trainer.train( +… model_arch=’resnet50’, +… train_data_dir=’path/to/data’, +… batch_size=64, +… nepochs=[10, 20], +… es_tolerance=5, +… plot_accuracy=True +… ) +New classifier head trained using transfer learning. +Fine-tuning the model… +Training complete.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.image_classifier.image_classifier.rst b/docs/rst-code/brails.processors.image_classifier.image_classifier.rst new file mode 100644 index 0000000..8263d59 --- /dev/null +++ b/docs/rst-code/brails.processors.image_classifier.image_classifier.rst @@ -0,0 +1,7 @@ +brails.processors.image\_classifier.image\_classifier module +============================================================ + +.. automodule:: brails.processors.image_classifier.image_classifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.image_classifier.rst b/docs/rst-code/brails.processors.image_classifier.rst new file mode 100644 index 0000000..9ee5043 --- /dev/null +++ b/docs/rst-code/brails.processors.image_classifier.rst @@ -0,0 +1,15 @@ +brails.processors.image\_classifier package +=========================================== + +.. automodule:: brails.processors.image_classifier + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.image_classifier.image_classifier diff --git a/docs/rst-code/brails.processors.image_processor.html b/docs/rst-code/brails.processors.image_processor.html new file mode 100644 index 0000000..68f2132 --- /dev/null +++ b/docs/rst-code/brails.processors.image_processor.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.image_processor module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.image_processor module

+
+
+class brails.processors.image_processor.ImageProcessor
+

Bases: ABC

+

The abstract interface defining the methods an ImageProcessing class must implement.

+
+
Methods:

predict(ImageSet): To return the predictions for the set of images provided

+
+
+
+
+abstract predict(images: ImageSet) dict
+

The pure virtual method that will be called to make the prediction

+
+
Args:

images (ImageSet): The set of images for which predictions are required

+
+
Returns:

dict: The keys being the same keys used in ImageSet.images, the values being a single prediction of an array of predictions

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.image_processor.rst b/docs/rst-code/brails.processors.image_processor.rst new file mode 100644 index 0000000..a02197b --- /dev/null +++ b/docs/rst-code/brails.processors.image_processor.rst @@ -0,0 +1,7 @@ +brails.processors.image\_processor module +========================================= + +.. automodule:: brails.processors.image_processor + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.image_segmenter.html b/docs/rst-code/brails.processors.image_segmenter.html new file mode 100644 index 0000000..81e6d2a --- /dev/null +++ b/docs/rst-code/brails.processors.image_segmenter.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.image_segmenter package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.image_segmenter package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.image_segmenter.image_segmenter.html b/docs/rst-code/brails.processors.image_segmenter.image_segmenter.html new file mode 100644 index 0000000..0be69e1 --- /dev/null +++ b/docs/rst-code/brails.processors.image_segmenter.image_segmenter.html @@ -0,0 +1,254 @@ + + + + + + + + + brails.processors.image_segmenter.image_segmenter module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.image_segmenter.image_segmenter module

+

Class objects to train and use image segmentation models.

+
+
+class brails.processors.image_segmenter.image_segmenter.DatasetBinary(root: str, imageFolder: str, maskFolder: str, transforms: Callable | None = None)
+

Bases: VisionDataset

+

Create a PyTorch dataset for binary masks.

+
+
Args__

root (str): Root directory of the dataset. +imageFolder (str): Folder name containing the images. +maskFolder (str): Folder name containing the binary masks. +transforms (Optional[Callable], optional): A function/transform to

+
+

apply to both the images and masks. Defaults to None.

+
+
+
Attributes__

image_names (List[Path]): List of paths to the image files. +mask_names (List[Path]): List of paths to the mask files.

+
+
+
+ +
+
+class brails.processors.image_segmenter.image_segmenter.DatasetRGB(root: str, imageFolder: str, maskFolder: str, transforms: Callable | None = None)
+

Bases: VisionDataset

+

Create a PyTorch dataset for RGB masks.

+
+
Args__

root (str): Root directory of the dataset. +imageFolder (str): Folder name containing the images. +maskFolder (str): Folder name containing the RGB masks. +transforms (Optional[Callable], optional): A function/transform to

+
+

apply to the images and masks. Defaults to None.

+
+
+
Attributes__

image_names (List[Path]): List of paths to the image files. +mask_names (List[Path]): List of paths to the mask files.

+
+
+
+ +
+
+class brails.processors.image_segmenter.image_segmenter.ImageSegmenter(modelArch='deeplabv3_resnet101')
+

Bases: object

+

A class to manage and train an image segmentation model.

+

This class provides methods to download train models using transfer +learning, retrain existing models, and make predictions using these models. +The class supports using different model architectures and performs +operations on GPU if available.

+
+
+predict(imdir: str, classes: List[str], model_path: str = 'tmp/models/trained_seg_model.pth') Dict[str, str]
+

Segment images in the specified directory using a pre-trained model.

+
+
Args__

imdir (str): The directory containing the images to be predicted. +classes (List[str]): List of class names corresponding to the

+
+

model’s output classes.

+
+
+
model_path (str, optional): Path to the trained model file.

Defaults to ‘tmp/models/trained_seg_model.pth’.

+
+
+
+
Returns__
+
Dict[str, str]: A dictionary where keys are image filenames and

values are predicted class labels.

+
+
+
+
Raises__

FileNotFoundError: If the specified model file does not exist. +NotADirectoryError: If the specified image directory is not a

+
+

directory.

+
+
+
ValueError: If the image directory is empty or no valid images are

found.

+
+
+
+
+
+ +
+
+train(train_data_dir: str, classes: List[str], batch_size: int = 2, nepochs: int = 100, es_tolerance: int = 10, plot_loss: bool = True) None
+

Train a segmentation model using the specified training input.

+
+
Args__
+
train_data_dir (str): Directory containing the training data.

It should have subdirectories for each class.

+
+
classes (List[str]): List of class names. The classes should

correspond to the subdirectories in train_data_dir.

+
+
batch_size (int, optional): Number of samples per batch.

Defaults to 2.

+
+
nepochs (int, optional): Number of epochs for training.

Defaults to 100.

+
+
es_tolerance (int, optional): Number of epochs to wait for

improvement before early stopping. Defaults to 10.

+
+
plot_loss (bool, optional): Whether to plot the training loss

curve. Defaults to True.

+
+
+
+
Raises__

FileNotFoundError: If the train_data_dir is not found. +ValueError: If classes is empty or if the number of epochs is

+
+

invalid.

+
+
+
Returns__

None

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.image_segmenter.image_segmenter.rst b/docs/rst-code/brails.processors.image_segmenter.image_segmenter.rst new file mode 100644 index 0000000..e2d4eae --- /dev/null +++ b/docs/rst-code/brails.processors.image_segmenter.image_segmenter.rst @@ -0,0 +1,7 @@ +brails.processors.image\_segmenter.image\_segmenter module +========================================================== + +.. automodule:: brails.processors.image_segmenter.image_segmenter + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.image_segmenter.rst b/docs/rst-code/brails.processors.image_segmenter.rst new file mode 100644 index 0000000..e4fb0ac --- /dev/null +++ b/docs/rst-code/brails.processors.image_segmenter.rst @@ -0,0 +1,15 @@ +brails.processors.image\_segmenter package +========================================== + +.. automodule:: brails.processors.image_segmenter + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.image_segmenter.image_segmenter diff --git a/docs/rst-code/brails.processors.nFloor_gpt.html b/docs/rst-code/brails.processors.nFloor_gpt.html new file mode 100644 index 0000000..1286416 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_gpt.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.nFloor_gpt package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nFloor_gpt package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nFloor_gpt.nFloor_gpt.html b/docs/rst-code/brails.processors.nFloor_gpt.nFloor_gpt.html new file mode 100644 index 0000000..670e116 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_gpt.nFloor_gpt.html @@ -0,0 +1,150 @@ + + + + + + + + + brails.processors.nFloor_gpt.nFloor_gpt module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nFloor_gpt.nFloor_gpt module

+
+
+class brails.processors.nFloor_gpt.nFloor_gpt.NFloorGPT(api_key, input_dict: dict | None = None)
+

Bases: GPT

+

The NFLoorGPT classifier attempts to predict number of floors using GPT-4o.

+

Variables

+
+
Methods:

predict(ImageSet): To return the predictions for the set of images provided

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nFloor_gpt.nFloor_gpt.rst b/docs/rst-code/brails.processors.nFloor_gpt.nFloor_gpt.rst new file mode 100644 index 0000000..7005227 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_gpt.nFloor_gpt.rst @@ -0,0 +1,7 @@ +brails.processors.nFloor\_gpt.nFloor\_gpt module +================================================ + +.. automodule:: brails.processors.nFloor_gpt.nFloor_gpt + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nFloor_gpt.rst b/docs/rst-code/brails.processors.nFloor_gpt.rst new file mode 100644 index 0000000..97bb920 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_gpt.rst @@ -0,0 +1,15 @@ +brails.processors.nFloor\_gpt package +===================================== + +.. automodule:: brails.processors.nFloor_gpt + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nFloor_gpt.nFloor_gpt diff --git a/docs/rst-code/brails.processors.nFloor_vlm.html b/docs/rst-code/brails.processors.nFloor_vlm.html new file mode 100644 index 0000000..af32db2 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_vlm.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.nFloor_vlm package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nFloor_vlm package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nFloor_vlm.nFloor_vlm.html b/docs/rst-code/brails.processors.nFloor_vlm.nFloor_vlm.html new file mode 100644 index 0000000..507a9c7 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_vlm.nFloor_vlm.html @@ -0,0 +1,163 @@ + + + + + + + + + brails.processors.nFloor_vlm.nFloor_vlm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nFloor_vlm.nFloor_vlm module

+

Class object to predict number of floors from street imagery using CLIP.

+
+
+class brails.processors.nFloor_vlm.nFloor_vlm.NFloorVLM(input_dict: dict | None = None)
+

Bases: CLIPClassifier

+

NFloorVLM classifier predicts number of floors in a building using CLIP.

+

This class is designed to initialize the classifier with text prompts and +classes related to the number of floors and make predictions from +street-level imagery.

+
+
Attributes__
+
text_prompts (List[str]): A list of text prompts for floor

classifications.

+
+
classes (List[int]): A list of classes representing the number of

floors (default [1, 2, 3])

+
+
+
+
Args__
+
input_dict (Optional[dict]): A dictionary containing prompts and

classes for customization.

+
+
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nFloor_vlm.nFloor_vlm.rst b/docs/rst-code/brails.processors.nFloor_vlm.nFloor_vlm.rst new file mode 100644 index 0000000..8b779ff --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_vlm.nFloor_vlm.rst @@ -0,0 +1,7 @@ +brails.processors.nFloor\_vlm.nFloor\_vlm module +================================================ + +.. automodule:: brails.processors.nFloor_vlm.nFloor_vlm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nFloor_vlm.rst b/docs/rst-code/brails.processors.nFloor_vlm.rst new file mode 100644 index 0000000..2f0eec7 --- /dev/null +++ b/docs/rst-code/brails.processors.nFloor_vlm.rst @@ -0,0 +1,15 @@ +brails.processors.nFloor\_vlm package +===================================== + +.. automodule:: brails.processors.nFloor_vlm + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nFloor_vlm.nFloor_vlm diff --git a/docs/rst-code/brails.processors.nfloors_detector.html b/docs/rst-code/brails.processors.nfloors_detector.html new file mode 100644 index 0000000..58b2750 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.html @@ -0,0 +1,155 @@ + + + + + + + + + brails.processors.nfloors_detector package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.backbone.html b/docs/rst-code/brails.processors.nfloors_detector.lib.backbone.html new file mode 100644 index 0000000..5b12176 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.backbone.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.backbone module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.backbone module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.backbone.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.backbone.rst new file mode 100644 index 0000000..75f41d4 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.backbone.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.backbone module +======================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.backbone + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.coco.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.coco.html new file mode 100644 index 0000000..22dd550 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.coco.html @@ -0,0 +1,218 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet.coco module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientdet.coco module

+
+
+class brails.processors.nfloors_detector.lib.efficientdet.coco.COCO(annotation_file=None)
+

Bases: object

+
+
+createIndex()
+
+ +
+
+getAnnIds(imgIds=[], catIds=[], areaRng=[], iscrowd=None)
+

Get ann ids that satisfy given filter conditions. default skips that filter +:param imgIds (int array) : get anns for given imgs

+
+

catIds (int array) : get anns for given cats +areaRng (float array) : get anns for given area range (e.g. [0 inf]) +iscrowd (boolean) : get anns for given crowd label (False or True)

+
+
+
Returns:
+

ids (int array) : integer array of ann ids

+
+
+
+ +
+
+getCatIds(catNms=[], supNms=[], catIds=[])
+

filtering parameters. default skips that filter. +:param catNms (str array) : get cats for given cat names +:param supNms (str array) : get cats for given supercategory names +:param catIds (int array) : get cats for given cat ids +:return: ids (int array) : integer array of cat ids

+
+ +
+
+getImgIds(imgIds=[], catIds=[])
+

Get img ids that satisfy given filter conditions. +:param imgIds (int array) : get imgs for given ids +:param catIds (int array) : get imgs with all given cats +:return: ids (int array) : integer array of img ids

+
+ +
+
+info()
+

Print information about the annotation file. +:return:

+
+ +
+
+loadAnns(ids=[])
+

Load anns with the specified ids. +:param ids (int array) : integer ids specifying anns +:return: anns (object array) : loaded ann objects

+
+ +
+
+loadCats(ids=[])
+

Load cats with the specified ids. +:param ids (int array) : integer ids specifying cats +:return: cats (object array) : loaded cat objects

+
+ +
+
+loadImgs(ids=[])
+

Load anns with the specified ids. +:param ids (int array) : integer ids specifying img +:return: imgs (object array) : loaded img objects

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.coco.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.coco.rst new file mode 100644 index 0000000..99b0aa3 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.coco.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientdet.coco module +================================================================ + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet.coco + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.config.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.config.html new file mode 100644 index 0000000..2aca3cb --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.config.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet.config module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientdet.config module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.config.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.config.rst new file mode 100644 index 0000000..0f64224 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.config.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientdet.config module +================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet.config + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.dataset.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.dataset.html new file mode 100644 index 0000000..ad3a7aa --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.dataset.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet.dataset module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientdet.dataset module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.dataset.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.dataset.rst new file mode 100644 index 0000000..fae68be --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.dataset.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientdet.dataset module +=================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet.dataset + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.html new file mode 100644 index 0000000..0378020 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.loss.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.loss.html new file mode 100644 index 0000000..99d1a25 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.loss.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet.loss module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientdet.loss module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.loss.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.loss.rst new file mode 100644 index 0000000..95b6324 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.loss.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientdet.loss module +================================================================ + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet.loss + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.model.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.model.html new file mode 100644 index 0000000..40f9b28 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.model.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet.model module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientdet.model module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.model.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.model.rst new file mode 100644 index 0000000..62ba7d4 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.model.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientdet.model module +================================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet.model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.rst new file mode 100644 index 0000000..60d8c11 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.rst @@ -0,0 +1,20 @@ +brails.processors.nfloors\_detector.lib.efficientdet package +============================================================ + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.efficientdet.coco + brails.processors.nfloors_detector.lib.efficientdet.config + brails.processors.nfloors_detector.lib.efficientdet.dataset + brails.processors.nfloors_detector.lib.efficientdet.loss + brails.processors.nfloors_detector.lib.efficientdet.model + brails.processors.nfloors_detector.lib.efficientdet.utils diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.utils.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.utils.html new file mode 100644 index 0000000..99ec30f --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.utils.html @@ -0,0 +1,210 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientdet.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientdet.utils module

+
+
+class brails.processors.nfloors_detector.lib.efficientdet.utils.Anchors(anchor_scale=4.0, pyramid_levels=None, **kwargs)
+

Bases: Module

+

adapted and modified from https://github.com/google/automl/blob/master/efficientdet/anchors.py by Zylo117

+
+
+forward(image, dtype=torch.float32)
+

Generates multiscale anchor boxes.

+
+
Args:
+
image_size: integer number of input image size. The input image has the

same dimension for width and height. The image_size should be divided by +the largest feature stride 2^max_level.

+
+
anchor_scale: float number representing the scale of size of the base

anchor to the feature stride 2^level.

+
+
anchor_configs: a dictionary with keys as the levels of anchors and

values as a list of anchor configuration.

+
+
+
+
Returns:
+
anchor_boxes: a numpy array with shape [N, 4], which stacks anchors on all

feature levels.

+
+
+
+
Raises:

ValueError: input size must be the multiple of largest feature stride.

+
+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientdet.utils.BBoxTransform(*args, **kwargs)
+

Bases: Module

+
+
+forward(anchors, regression)
+

decode_box_outputs adapted from https://github.com/google/automl/blob/master/efficientdet/anchors.py

+
+
Args:

anchors: [batchsize, boxes, (y1, x1, y2, x2)] +regression: [batchsize, boxes, (dy, dx, dh, dw)]

+
+
+

Returns:

+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientdet.utils.ClipBoxes
+

Bases: Module

+
+
+forward(boxes, img)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.utils.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.utils.rst new file mode 100644 index 0000000..265931b --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientdet.utils.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientdet.utils module +================================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.efficientdet.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.html new file mode 100644 index 0000000..8d38634 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientnet package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.model.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.model.html new file mode 100644 index 0000000..3d46644 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.model.html @@ -0,0 +1,223 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientnet.model module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientnet.model module

+
+
+class brails.processors.nfloors_detector.lib.efficientnet.model.EfficientNet(blocks_args=None, global_params=None)
+

Bases: Module

+

An EfficientNet model. Most easily loaded with the .from_name or .from_pretrained methods

+
+
Args:

blocks_args (list): A list of BlockArgs to construct blocks +global_params (namedtuple): A set of GlobalParams shared between blocks

+
+
Example:

model = EfficientNet.from_pretrained(‘efficientnet-b0’)

+
+
+
+
+extract_features(inputs)
+

Returns output of the final convolution layer

+
+ +
+
+forward(inputs)
+

Calls extract_features to extract features, applies final linear layer, and returns logits.

+
+ +
+
+classmethod from_name(model_name, override_params=None)
+
+ +
+
+classmethod from_pretrained(model_name, load_weights=True, advprop=False, num_classes=1000, in_channels=3)
+
+ +
+
+classmethod get_image_size(model_name)
+
+ +
+
+set_swish(memory_efficient=True)
+

Sets swish function as memory efficient (for training) or standard (for export)

+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.model.MBConvBlock(block_args, global_params)
+

Bases: Module

+

Mobile Inverted Residual Bottleneck Block

+
+
Args:

block_args (namedtuple): BlockArgs, see above +global_params (namedtuple): GlobalParam, see above

+
+
Attributes:

has_se (bool): Whether the block contains a Squeeze and Excitation layer.

+
+
+
+
+forward(inputs, drop_connect_rate=None)
+
+
Parameters:
+
    +
  • inputs – input tensor

  • +
  • drop_connect_rate – drop connect rate (float, between 0 and 1)

  • +
+
+
Returns:
+

output of block

+
+
+
+ +
+
+set_swish(memory_efficient=True)
+

Sets swish function as memory efficient (for training) or standard (for export)

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.model.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.model.rst new file mode 100644 index 0000000..6834356 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.model.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientnet.model module +================================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.efficientnet.model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.rst new file mode 100644 index 0000000..368c014 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.rst @@ -0,0 +1,17 @@ +brails.processors.nfloors\_detector.lib.efficientnet package +============================================================ + +.. automodule:: brails.processors.nfloors_detector.lib.efficientnet + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.efficientnet.model + brails.processors.nfloors_detector.lib.efficientnet.utils + brails.processors.nfloors_detector.lib.efficientnet.utils_extra diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils.html new file mode 100644 index 0000000..cc860e6 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils.html @@ -0,0 +1,499 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientnet.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientnet.utils module

+

This file contains helper functions for building the model and for loading model parameters. +These helper functions are built to mirror those in the official TensorFlow implementation.

+
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.BlockArgs(kernel_size, num_repeat, input_filters, output_filters, expand_ratio, id_skip, stride, se_ratio)
+

Bases: tuple

+
+
+expand_ratio
+

Alias for field number 4

+
+ +
+
+id_skip
+

Alias for field number 5

+
+ +
+
+input_filters
+

Alias for field number 2

+
+ +
+
+kernel_size
+

Alias for field number 0

+
+ +
+
+num_repeat
+

Alias for field number 1

+
+ +
+
+output_filters
+

Alias for field number 3

+
+ +
+
+se_ratio
+

Alias for field number 7

+
+ +
+
+stride
+

Alias for field number 6

+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.BlockDecoder
+

Bases: object

+

Block Decoder for readability, straight from the official TensorFlow repository

+
+
+static decode(string_list)
+

Decodes a list of string notations to specify blocks inside the network.

+
+
Parameters:
+

string_list – a list of strings, each string is a notation of block

+
+
Returns:
+

a list of BlockArgs namedtuples of block args

+
+
+
+ +
+
+static encode(blocks_args)
+

Encodes a list of BlockArgs to a list of strings.

+
+
Parameters:
+

blocks_args – a list of BlockArgs namedtuples of block args

+
+
Returns:
+

a list of strings, each string is a notation of block

+
+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.Conv2dDynamicSamePadding(in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1, bias=True)
+

Bases: Conv2d

+

2D Convolutions like TensorFlow, for a dynamic image size

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.GlobalParams(batch_norm_momentum, batch_norm_epsilon, dropout_rate, num_classes, width_coefficient, depth_coefficient, depth_divisor, min_depth, drop_connect_rate, image_size)
+

Bases: tuple

+
+
+batch_norm_epsilon
+

Alias for field number 1

+
+ +
+
+batch_norm_momentum
+

Alias for field number 0

+
+ +
+
+depth_coefficient
+

Alias for field number 5

+
+ +
+
+depth_divisor
+

Alias for field number 6

+
+ +
+
+drop_connect_rate
+

Alias for field number 8

+
+ +
+
+dropout_rate
+

Alias for field number 2

+
+ +
+
+image_size
+

Alias for field number 9

+
+ +
+
+min_depth
+

Alias for field number 7

+
+ +
+
+num_classes
+

Alias for field number 3

+
+ +
+
+width_coefficient
+

Alias for field number 4

+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.Identity
+

Bases: Module

+
+
+forward(input)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.MemoryEfficientSwish(*args, **kwargs)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.Swish(*args, **kwargs)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils.SwishImplementation(*args, **kwargs)
+

Bases: Function

+
+
+static backward(ctx, grad_output)
+

Define a formula for differentiating the operation with backward mode automatic differentiation.

+

This function is to be overridden by all subclasses. +(Defining this function is equivalent to defining the vjp function.)

+

It must accept a context ctx as the first argument, followed by +as many outputs as the forward() returned (None will be passed in +for non tensor outputs of the forward function), +and it should return as many tensors, as there were inputs to +forward(). Each argument is the gradient w.r.t the given output, +and each returned value should be the gradient w.r.t. the +corresponding input. If an input is not a Tensor or is a Tensor not +requiring grads, you can just pass None as a gradient for that input.

+

The context can be used to retrieve tensors saved during the forward +pass. It also has an attribute ctx.needs_input_grad as a tuple +of booleans representing whether each input needs gradient. E.g., +backward() will have ctx.needs_input_grad[0] = True if the +first input to forward() needs gradient computed w.r.t. the +output.

+
+ +
+
+static forward(ctx, i)
+

Define the forward of the custom autograd Function.

+

This function is to be overridden by all subclasses. +There are two ways to define forward:

+

Usage 1 (Combined forward and ctx):

+
@staticmethod
+def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any:
+    pass
+
+
+
    +
  • It must accept a context ctx as the first argument, followed by any +number of arguments (tensors or other types).

  • +
  • See combining-forward-context for more details

  • +
+

Usage 2 (Separate forward and ctx):

+
@staticmethod
+def forward(*args: Any, **kwargs: Any) -> Any:
+    pass
+
+@staticmethod
+def setup_context(ctx: Any, inputs: Tuple[Any, ...], output: Any) -> None:
+    pass
+
+
+
    +
  • The forward no longer accepts a ctx argument.

  • +
  • Instead, you must also override the torch.autograd.Function.setup_context() +staticmethod to handle setting up the ctx object. +output is the output of the forward, inputs are a Tuple of inputs +to the forward.

  • +
  • See extending-autograd for more details

  • +
+

The context can be used to store arbitrary data that can be then +retrieved during the backward pass. Tensors should not be stored +directly on ctx (though this is not currently enforced for +backward compatibility). Instead, tensors should be saved either with +ctx.save_for_backward() if they are intended to be used in +backward (equivalently, vjp) or ctx.save_for_forward() +if they are intended to be used for in jvp.

+
+ +
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.drop_connect(inputs, p, training)
+

Drop connect.

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.efficientnet(width_coefficient=None, depth_coefficient=None, dropout_rate=0.2, drop_connect_rate=0.2, image_size=None, num_classes=1000)
+

Creates a efficientnet model.

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.efficientnet_params(model_name)
+

Map EfficientNet model name to parameter coefficients.

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.get_model_params(model_name, override_params)
+

Get the block args and global params for a given model

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.get_same_padding_conv2d(image_size=None)
+

Chooses static padding if you have specified an image size, and dynamic padding otherwise. +Static padding is necessary for ONNX exporting of models.

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.load_pretrained_weights(model, model_name, load_fc=True, advprop=False)
+

Loads pretrained weights, and downloads if loading for the first time.

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.round_filters(filters, global_params)
+

Calculate and round number of filters based on depth multiplier.

+
+ +
+
+brails.processors.nfloors_detector.lib.efficientnet.utils.round_repeats(repeats, global_params)
+

Round number of filters based on depth multiplier.

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils.rst new file mode 100644 index 0000000..14927ee --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientnet.utils module +================================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.efficientnet.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils_extra.html b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils_extra.html new file mode 100644 index 0000000..fe8e35d --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils_extra.html @@ -0,0 +1,184 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.efficientnet.utils_extra module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.efficientnet.utils_extra module

+
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils_extra.Conv2dStaticSamePadding(in_channels, out_channels, kernel_size, stride=1, bias=True, groups=1, dilation=1, **kwargs)
+

Bases: Module

+

created by Zylo117 +The real keras/tensorflow conv2d with same padding

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.efficientnet.utils_extra.MaxPool2dStaticSamePadding(*args, **kwargs)
+

Bases: Module

+

created by Zylo117 +The real keras/tensorflow MaxPool2d with same padding

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils_extra.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils_extra.rst new file mode 100644 index 0000000..71a311a --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.efficientnet.utils_extra.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.efficientnet.utils\_extra module +======================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.efficientnet.utils_extra + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.html b/docs/rst-code/brails.processors.nfloors_detector.lib.html new file mode 100644 index 0000000..78ee3b4 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.nfloors_detector.lib package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.infer_detector.html b/docs/rst-code/brails.processors.nfloors_detector.lib.infer_detector.html new file mode 100644 index 0000000..93902f2 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.infer_detector.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.infer_detector module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.infer_detector module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.infer_detector.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.infer_detector.rst new file mode 100644 index 0000000..4041ca7 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.infer_detector.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.infer\_detector module +============================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.infer_detector + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.rst new file mode 100644 index 0000000..1a3a2d5 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.rst @@ -0,0 +1,27 @@ +brails.processors.nfloors\_detector.lib package +=============================================== + +.. automodule:: brails.processors.nfloors_detector.lib + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.efficientdet + brails.processors.nfloors_detector.lib.efficientnet + brails.processors.nfloors_detector.lib.utils + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.backbone + brails.processors.nfloors_detector.lib.infer_detector + brails.processors.nfloors_detector.lib.train_detector diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.train_detector.html b/docs/rst-code/brails.processors.nfloors_detector.lib.train_detector.html new file mode 100644 index 0000000..72f982f --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.train_detector.html @@ -0,0 +1,139 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.train_detector module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.train_detector module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.train_detector.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.train_detector.rst new file mode 100644 index 0000000..d823639 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.train_detector.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.train\_detector module +============================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.train_detector + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.html new file mode 100644 index 0000000..33165f3 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.html @@ -0,0 +1,157 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.rst new file mode 100644 index 0000000..d47430f --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.rst @@ -0,0 +1,23 @@ +brails.processors.nfloors\_detector.lib.utils package +===================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.utils + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.utils.utils diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.html new file mode 100644 index 0000000..952b4b0 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.html @@ -0,0 +1,336 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm module

+
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.SynchronizedBatchNorm1d(num_features, eps=1e-05, momentum=0.1, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Synchronized Batch Normalization over a 2d or 3d input that is seen as a +mini-batch.

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm1d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, L) slices, it’s common terminology to call this Temporal BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of size

batch_size x num_features [x width]

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape::
    +
  • Input: \((N, C)\) or \((N, C, L)\)

  • +
  • Output: \((N, C)\) or \((N, C, L)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm1d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm1d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.SynchronizedBatchNorm2d(num_features, eps=1e-05, momentum=0.1, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Batch Normalization over a 4d input that is seen as a mini-batch +of 3d inputs

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm2d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, H, W) slices, it’s common terminology to call this Spatial BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of

size batch_size x num_features x height x width

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape::
    +
  • Input: \((N, C, H, W)\)

  • +
  • Output: \((N, C, H, W)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm2d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm2d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100, 35, 45))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.SynchronizedBatchNorm3d(num_features, eps=1e-05, momentum=0.1, affine=True)
+

Bases: _SynchronizedBatchNorm

+

Applies Batch Normalization over a 5d input that is seen as a mini-batch +of 4d inputs

+
+\[y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta\]
+

This module differs from the built-in PyTorch BatchNorm3d as the mean and +standard-deviation are reduced across all devices during training.

+

For example, when one uses nn.DataParallel to wrap the network during +training, PyTorch’s implementation normalize the tensor on each device using +the statistics only on that device, which accelerated the computation and +is also easy to implement, but the statistics might be inaccurate. +Instead, in this synchronized version, the statistics will be computed +over all training samples distributed on multiple devices.

+

Note that, for one-GPU or CPU-only case, this module behaves exactly same +as the built-in PyTorch implementation.

+

The mean and standard-deviation are calculated per-dimension over +the mini-batches and gamma and beta are learnable parameter vectors +of size C (where C is the input size).

+

During training, this layer keeps a running estimate of its computed mean +and variance. The running sum is kept with a default momentum of 0.1.

+

During evaluation, this running mean/variance is used for normalization.

+

Because the BatchNorm is done over the C dimension, computing statistics +on (N, D, H, W) slices, it’s common terminology to call this Volumetric BatchNorm +or Spatio-temporal BatchNorm

+
+
Args:
+
num_features: num_features from an expected input of

size batch_size x num_features x depth x height x width

+
+
eps: a value added to the denominator for numerical stability.

Default: 1e-5

+
+
momentum: the value used for the running_mean and running_var

computation. Default: 0.1

+
+
affine: a boolean value that when set to True, gives the layer learnable

affine parameters. Default: True

+
+
+
+
Shape::
    +
  • Input: \((N, C, D, H, W)\)

  • +
  • Output: \((N, C, D, H, W)\) (same shape as input)

  • +
+
+
Examples:
>>> # With Learnable Parameters
+>>> m = SynchronizedBatchNorm3d(100)
+>>> # Without Learnable Parameters
+>>> m = SynchronizedBatchNorm3d(100, affine=False)
+>>> input = torch.autograd.Variable(torch.randn(20, 100, 35, 45, 10))
+>>> output = m(input)
+
+
+
+
+
+ +
+
+brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.convert_model(module)
+
+
Traverse the input module and its child recursively

and replace all instance of torch.nn.modules.batchnorm.BatchNorm*N*d +to SynchronizedBatchNorm*N*d

+
+
Args:

module: the input module needs to be convert to SyncBN model

+
+
Examples:
>>> import torch.nn as nn
+>>> import torchvision
+>>> # m is a standard pytorch model
+>>> m = torchvision.models.resnet18(True)
+>>> m = nn.DataParallel(m)
+>>> # after convert, m is using SyncBN
+>>> m = convert_model(m)
+
+
+
+
+
+ +
+
+brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.patch_sync_batchnorm()
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.rst new file mode 100644 index 0000000..827fab0 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.utils.sync\_batchnorm.batchnorm module +============================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.html new file mode 100644 index 0000000..84cac1e --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.html @@ -0,0 +1,176 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl module

+
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.BatchNorm2dReimpl(num_features, eps=1e-05, momentum=0.1)
+

Bases: Module

+

A re-implementation of batch normalization, used for testing the numerical +stability.

+

Author: acgtyrant +See also: +https://github.com/vacancy/Synchronized-BatchNorm-PyTorch/issues/14

+
+
+forward(input_)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+reset_parameters()
+
+ +
+
+reset_running_stats()
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.rst new file mode 100644 index 0000000..5030cf3 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.utils.sync\_batchnorm.batchnorm\_reimpl module +====================================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.html new file mode 100644 index 0000000..36242a8 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.html @@ -0,0 +1,216 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm module

+
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.FutureResult
+

Bases: object

+

A thread-safe future implementation. Used only as one-to-one pipe.

+
+
+get()
+
+ +
+
+put(result)
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.SlavePipe(identifier, queue, result)
+

Bases: _SlavePipeBase

+

Pipe for master-slave communication.

+
+
+run_slave(msg)
+
+ +
+ +
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.SyncMaster(master_callback)
+

Bases: object

+

An abstract SyncMaster object.

+
    +
  • During the replication, as the data parallel will trigger an callback of each module, all slave devices should

  • +
+

call register(id) and obtain an SlavePipe to communicate with the master. +- During the forward pass, master device invokes run_master, all messages from slave devices will be collected, +and passed to a registered callback. +- After receiving the messages, the master device should gather the information and determine to message passed +back to each slave devices.

+
+
+property nr_slaves
+
+ +
+
+register_slave(identifier)
+

Register an slave device.

+
+
Args:

identifier: an identifier, usually is the device id.

+
+
+

Returns: a SlavePipe object which can be used to communicate with the master device.

+
+ +
+
+run_master(master_msg)
+

Main entry for the master device in each forward pass. +The messages were first collected from each devices (including the master device), and then +an callback will be invoked to compute the message to be sent back to each devices +(including the master device).

+
+
Args:

master_msg: the message that the master want to send to itself. This will be placed as the first +message when calling master_callback. For detailed usage, see _SynchronizedBatchNorm for an example.

+
+
+

Returns: the message to be sent back to the master device.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.rst new file mode 100644 index 0000000..279fef7 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.utils.sync\_batchnorm.comm module +========================================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.html new file mode 100644 index 0000000..5538302 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.html @@ -0,0 +1,154 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.html new file mode 100644 index 0000000..c038d8f --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.html @@ -0,0 +1,196 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate module

+
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.CallbackContext
+

Bases: object

+
+ +
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.DataParallelWithCallback(module: T, device_ids: Sequence[int | device] | None = None, output_device: int | device | None = None, dim: int = 0)
+

Bases: DataParallel

+

Data Parallel with a replication callback.

+

An replication callback __data_parallel_replicate__ of each module will be invoked after being created by +original replicate function. +The callback will be invoked with arguments __data_parallel_replicate__(ctx, copy_id)

+
+
Examples:

> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1]) +# sync_bn.__data_parallel_replicate__ will be invoked.

+
+
+
+
+replicate(module, device_ids)
+
+ +
+ +
+
+brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.execute_replication_callbacks(modules)
+

Execute an replication callback __data_parallel_replicate__ on each module created by original replication.

+

The callback will be invoked with arguments __data_parallel_replicate__(ctx, copy_id)

+

Note that, as all modules are isomorphism, we assign each sub-module with a context +(shared among multiple copies of this module on different devices). +Through this context, different copies can share some information.

+

We guarantee that the callback on the master copy (the first copy) will be called ahead of calling the callback +of any slave copies.

+
+ +
+
+brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.patch_replication_callback(data_parallel)
+

Monkey-patch an existing DataParallel object. Add the replication callback. +Useful when you have customized DataParallel implementation.

+
+
Examples:

> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallel(sync_bn, device_ids=[0, 1]) +> patch_replication_callback(sync_bn) +# this is equivalent to +> sync_bn = SynchronizedBatchNorm1d(10, eps=1e-5, affine=False) +> sync_bn = DataParallelWithCallback(sync_bn, device_ids=[0, 1])

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.rst new file mode 100644 index 0000000..6c895f2 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.utils.sync\_batchnorm.replicate module +============================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.rst new file mode 100644 index 0000000..19d4725 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.rst @@ -0,0 +1,19 @@ +brails.processors.nfloors\_detector.lib.utils.sync\_batchnorm package +===================================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.utils.sync_batchnorm + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.batchnorm_reimpl + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.comm + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.replicate + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.html new file mode 100644 index 0000000..8fcc478 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.html @@ -0,0 +1,152 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest module

+
+
+class brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.TorchTestCase(methodName='runTest')
+

Bases: TestCase

+
+
+assertTensorClose(x, y)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.rst new file mode 100644 index 0000000..4229ad3 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.utils.sync\_batchnorm.unittest module +============================================================================= + +.. automodule:: brails.processors.nfloors_detector.lib.utils.sync_batchnorm.unittest + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.utils.html b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.utils.html new file mode 100644 index 0000000..301cc48 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.utils.html @@ -0,0 +1,140 @@ + + + + + + + + + brails.processors.nfloors_detector.lib.utils.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.lib.utils.utils module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.lib.utils.utils.rst b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.utils.rst new file mode 100644 index 0000000..fe7259f --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.lib.utils.utils.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.lib.utils.utils module +========================================================== + +.. automodule:: brails.processors.nfloors_detector.lib.utils.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.nfloor_detector.html b/docs/rst-code/brails.processors.nfloors_detector.nfloor_detector.html new file mode 100644 index 0000000..d26e80f --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.nfloor_detector.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.nfloors_detector.nfloor_detector module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.nfloors_detector.nfloor_detector module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.nfloors_detector.nfloor_detector.rst b/docs/rst-code/brails.processors.nfloors_detector.nfloor_detector.rst new file mode 100644 index 0000000..73fc287 --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.nfloor_detector.rst @@ -0,0 +1,7 @@ +brails.processors.nfloors\_detector.nfloor\_detector module +=========================================================== + +.. automodule:: brails.processors.nfloors_detector.nfloor_detector + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.nfloors_detector.rst b/docs/rst-code/brails.processors.nfloors_detector.rst new file mode 100644 index 0000000..4d938dc --- /dev/null +++ b/docs/rst-code/brails.processors.nfloors_detector.rst @@ -0,0 +1,23 @@ +brails.processors.nfloors\_detector package +=========================================== + +.. automodule:: brails.processors.nfloors_detector + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.lib + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.nfloors_detector.nfloor_detector diff --git a/docs/rst-code/brails.processors.occupancy_classifier.html b/docs/rst-code/brails.processors.occupancy_classifier.html new file mode 100644 index 0000000..866eab8 --- /dev/null +++ b/docs/rst-code/brails.processors.occupancy_classifier.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.occupancy_classifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.occupancy_classifier package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.occupancy_classifier.occupancy_classifier.html b/docs/rst-code/brails.processors.occupancy_classifier.occupancy_classifier.html new file mode 100644 index 0000000..b95095b --- /dev/null +++ b/docs/rst-code/brails.processors.occupancy_classifier.occupancy_classifier.html @@ -0,0 +1,257 @@ + + + + + + + + + brails.processors.occupancy_classifier.occupancy_classifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.occupancy_classifier.occupancy_classifier module

+
+
+class brails.processors.occupancy_classifier.occupancy_classifier.OccupancyClassifier(input_data: dict | None = None)
+

Bases: ImageClassifier

+

The OccupancyClassifier classifier attempts to predict occupancy types of +buildings as 1 of 2 types: Residential or Other. The classification is done +by the ImageClassifier class. This class is a wrapper that just sets up the +inputs for that class.

+
+
Variables

model_path: str Path to the model file

+
+
Methods:
+
predict(ImageSet): To return the predictions for the set of images

provided

+
+
+
+
+
+
+predict(images: ImageSet) dict
+

The method that predicts building occupancy type.

+
+
Args
+
images: ImageSet containing the set of images for which a

prediction is required

+
+
+
+
Returns
+
dict: Dictionary with keys set to image names in ImageSet.images

and values set to the predicted occupancy types

+
+
+
+
+
+ +
+
+retrain(dataDir, batchSize=8, nepochs=100, plotLoss=True)
+

Retrain existing model using training dataset and hyperparameters.

+

Parameters__ +- model_path (str): Path to the pre-trained model to be fine-tuned.

+
+

Default is ‘tmp/models/trained_model.pth’.

+
+
    +
  • +
    train_data_dir (str): Directory containing the training and

    validation datasets. Default is ‘tmp/hymenoptera_data’.

    +
    +
    +
  • +
  • +
    model_inp_size (int): Input size for the model, used for resizing

    images in the dataset. Default is 384.

    +
    +
    +
  • +
  • batch_size (int): Batch size for data loading. Default is 32.

  • +
  • +
    nepochs (Union[int, List[int]]): Number of epochs for training.

    Should be an integer for retraining. Default is 100.

    +
    +
    +
  • +
  • +
    es_tolerance (int): Early stopping tolerance; the number of epochs

    without improvement before stopping. Default is 10.

    +
    +
    +
  • +
  • +
    plot_accuracy (bool): Whether to plot the validation accuracy over

    epochs. Default is True.

    +
    +
    +
  • +
+

Returns__ +- None

+

Raises__ +- ValueError: If nepochs is not provided as an integer during

+
+

retraining.

+
+

Procedure__ +1. Loads the model from the specified path. +2. Applies data augmentation and normalization to the training dataset

+
+

and normalization to the validation dataset.

+
+
    +
  1. +
    If the default training data directory is used, downloads a sample

    dataset.

    +
    +
    +
  2. +
  3. +
    Prepares PyTorch DataLoader objects for the training and

    validation datasets.

    +
    +
    +
  4. +
  5. +
    Sends the model to the GPU and fine-tunes it using Stochastic

    Gradient Descent (SGD) optimization.

    +
    +
    +
  6. +
  7. After training, the model is saved at the specified path.

  8. +
  9. +
    If plot_accuracy is True, plots the validation accuracy versus

    training epochs.

    +
    +
    +
  10. +
+

Example__ +>>> classifier = ImageClassifier() +>>> classifier.retrain(model_path=’model.pth’,

+
+

train_data_dir=’my_data’, +nepochs=50)

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.occupancy_classifier.occupancy_classifier.rst b/docs/rst-code/brails.processors.occupancy_classifier.occupancy_classifier.rst new file mode 100644 index 0000000..b0ee9e1 --- /dev/null +++ b/docs/rst-code/brails.processors.occupancy_classifier.occupancy_classifier.rst @@ -0,0 +1,7 @@ +brails.processors.occupancy\_classifier.occupancy\_classifier module +==================================================================== + +.. automodule:: brails.processors.occupancy_classifier.occupancy_classifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.occupancy_classifier.rst b/docs/rst-code/brails.processors.occupancy_classifier.rst new file mode 100644 index 0000000..4e619f0 --- /dev/null +++ b/docs/rst-code/brails.processors.occupancy_classifier.rst @@ -0,0 +1,15 @@ +brails.processors.occupancy\_classifier package +=============================================== + +.. automodule:: brails.processors.occupancy_classifier + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.occupancy_classifier.occupancy_classifier diff --git a/docs/rst-code/brails.processors.other_idea.arial_processing.html b/docs/rst-code/brails.processors.other_idea.arial_processing.html new file mode 100644 index 0000000..0726950 --- /dev/null +++ b/docs/rst-code/brails.processors.other_idea.arial_processing.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.other_idea.arial_processing module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.other_idea.arial_processing module

+
+
+class brails.processors.other_idea.arial_processing.ArialProcessing(name)
+

Bases: ABC

+
+
+abstract predict(image)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.other_idea.arial_processing.rst b/docs/rst-code/brails.processors.other_idea.arial_processing.rst new file mode 100644 index 0000000..34b4722 --- /dev/null +++ b/docs/rst-code/brails.processors.other_idea.arial_processing.rst @@ -0,0 +1,7 @@ +brails.processors.other\_idea.arial\_processing module +====================================================== + +.. automodule:: brails.processors.other_idea.arial_processing + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.other_idea.html b/docs/rst-code/brails.processors.other_idea.html new file mode 100644 index 0000000..caa6518 --- /dev/null +++ b/docs/rst-code/brails.processors.other_idea.html @@ -0,0 +1,146 @@ + + + + + + + + + brails.processors.other_idea package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.other_idea package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.other_idea.rst b/docs/rst-code/brails.processors.other_idea.rst new file mode 100644 index 0000000..66fe832 --- /dev/null +++ b/docs/rst-code/brails.processors.other_idea.rst @@ -0,0 +1,16 @@ +brails.processors.other\_idea package +===================================== + +.. automodule:: brails.processors.other_idea + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.other_idea.arial_processing + brails.processors.other_idea.street_processor diff --git a/docs/rst-code/brails.processors.other_idea.street_processor.html b/docs/rst-code/brails.processors.other_idea.street_processor.html new file mode 100644 index 0000000..829ba66 --- /dev/null +++ b/docs/rst-code/brails.processors.other_idea.street_processor.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.other_idea.street_processor module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.other_idea.street_processor module

+
+
+class brails.processors.other_idea.street_processor.StreetProcessor(name)
+

Bases: ABC

+
+
+abstract predict(images_street, images_arial)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.other_idea.street_processor.rst b/docs/rst-code/brails.processors.other_idea.street_processor.rst new file mode 100644 index 0000000..10f9ad0 --- /dev/null +++ b/docs/rst-code/brails.processors.other_idea.street_processor.rst @@ -0,0 +1,7 @@ +brails.processors.other\_idea.street\_processor module +====================================================== + +.. automodule:: brails.processors.other_idea.street_processor + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.roof_shape_classifier.html b/docs/rst-code/brails.processors.roof_shape_classifier.html new file mode 100644 index 0000000..b785cd6 --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_classifier.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.roof_shape_classifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.roof_shape_classifier package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.roof_shape_classifier.roof_shape_classifier.html b/docs/rst-code/brails.processors.roof_shape_classifier.roof_shape_classifier.html new file mode 100644 index 0000000..8d79a25 --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_classifier.roof_shape_classifier.html @@ -0,0 +1,196 @@ + + + + + + + + + brails.processors.roof_shape_classifier.roof_shape_classifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.roof_shape_classifier.roof_shape_classifier module

+

Class object to use and retrain the roof type classifier model.

+
+
+class brails.processors.roof_shape_classifier.roof_shape_classifier.RoofShapeClassifier(input_data: dict | None = None)
+

Bases: ImageClassifier

+

RoofShapeClassifier predicts roof shapes from aerial imagery.

+

This classifier serves as a wrapper around the ImageClassifier class, +setting up the necessary inputs for roof type classification.

+
+
Attributes__

model_path (str): Path to the model file. +classes (List[str]): List of roof type classes that will be predicted.

+
+
Methods__
+
predict(images: ImageSet) -> Dict[str, str]:

Returns predictions for the set of images provided.

+
+
retrain(data_dir, batch_size=8, nepochs=100, plot_loss=True)

Retrains the roof type classifier model with the provided data.

+
+
+
+
+
+
+predict(images: ImageSet) dict
+

Predict the roof shape for the given images.

+
+
Args__
+
images (ImageSet): The set of images for which predictions are

required.

+
+
+
+
Returns__
+
dict: A dictionary mapping image keys to their predicted roof

shapes. The keys correspond to the same keys used in +ImageSet.images, and the values are the predicted roof shape +(Flat, Gable, or Hip).

+
+
+
+
+
+ +
+
+retrain(data_dir, batch_size=8, nepochs=100, plot_loss=True)
+

Retrains the roof type classifier model with the provided data.

+
+
Args__

data_dir (str): The directory containing training data. +batch_size (int): The number of samples per batch. Default is 8. +nepochs (int): The number of epochs for training. Default is 100. +plot_loss (bool): Whether to plot the loss during training. Default

+
+

is True.

+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.roof_shape_classifier.roof_shape_classifier.rst b/docs/rst-code/brails.processors.roof_shape_classifier.roof_shape_classifier.rst new file mode 100644 index 0000000..6f30667 --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_classifier.roof_shape_classifier.rst @@ -0,0 +1,7 @@ +brails.processors.roof\_shape\_classifier.roof\_shape\_classifier module +======================================================================== + +.. automodule:: brails.processors.roof_shape_classifier.roof_shape_classifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.roof_shape_classifier.rst b/docs/rst-code/brails.processors.roof_shape_classifier.rst new file mode 100644 index 0000000..2e078c9 --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_classifier.rst @@ -0,0 +1,15 @@ +brails.processors.roof\_shape\_classifier package +================================================= + +.. automodule:: brails.processors.roof_shape_classifier + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.roof_shape_classifier.roof_shape_classifier diff --git a/docs/rst-code/brails.processors.roof_shape_gpt.html b/docs/rst-code/brails.processors.roof_shape_gpt.html new file mode 100644 index 0000000..0dfae3b --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_gpt.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.roof_shape_gpt package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.roof_shape_gpt package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.roof_shape_gpt.roof_shape_gpt.html b/docs/rst-code/brails.processors.roof_shape_gpt.roof_shape_gpt.html new file mode 100644 index 0000000..a6d565f --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_gpt.roof_shape_gpt.html @@ -0,0 +1,150 @@ + + + + + + + + + brails.processors.roof_shape_gpt.roof_shape_gpt module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.roof_shape_gpt.roof_shape_gpt module

+
+
+class brails.processors.roof_shape_gpt.roof_shape_gpt.RoofShapeGPT(api_key, input_dict: dict | None = None)
+

Bases: GPT

+

The NFLoorGPT classifier attempts to predict number of floors using GPT-4o.

+

Variables

+
+
Methods:

predict(ImageSet): To return the predictions for the set of images provided

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.roof_shape_gpt.roof_shape_gpt.rst b/docs/rst-code/brails.processors.roof_shape_gpt.roof_shape_gpt.rst new file mode 100644 index 0000000..270bdcc --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_gpt.roof_shape_gpt.rst @@ -0,0 +1,7 @@ +brails.processors.roof\_shape\_gpt.roof\_shape\_gpt module +========================================================== + +.. automodule:: brails.processors.roof_shape_gpt.roof_shape_gpt + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.roof_shape_gpt.rst b/docs/rst-code/brails.processors.roof_shape_gpt.rst new file mode 100644 index 0000000..666a166 --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_gpt.rst @@ -0,0 +1,15 @@ +brails.processors.roof\_shape\_gpt package +========================================== + +.. automodule:: brails.processors.roof_shape_gpt + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.roof_shape_gpt.roof_shape_gpt diff --git a/docs/rst-code/brails.processors.roof_shape_vlm.html b/docs/rst-code/brails.processors.roof_shape_vlm.html new file mode 100644 index 0000000..f5a7cff --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_vlm.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.processors.roof_shape_vlm package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.roof_shape_vlm package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.roof_shape_vlm.roof_shape_vlm.html b/docs/rst-code/brails.processors.roof_shape_vlm.roof_shape_vlm.html new file mode 100644 index 0000000..f9582ed --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_vlm.roof_shape_vlm.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.roof_shape_vlm.roof_shape_vlm module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.roof_shape_vlm.roof_shape_vlm module

+

Class object to predict roof types from aerial imagery using CLIP.

+
+
+class brails.processors.roof_shape_vlm.roof_shape_vlm.RoofShapeVLM(input_dict: dict | None = None)
+

Bases: CLIPClassifier

+

RoofShapeVLM classifier attempts to predict roof shapes using CLIP model.

+
+
Attributes__
+
input_dict (Optional[dict]): A dictionary containing prompts and class

information.

+
+
+

text_prompts (list): A list of textual prompts for the classifier. +classes (list): A list of roof shape classes.

+
+
Methods__
+
predict(ImageSet): Returns the predictions for the set of images

provided.

+
+
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.roof_shape_vlm.roof_shape_vlm.rst b/docs/rst-code/brails.processors.roof_shape_vlm.roof_shape_vlm.rst new file mode 100644 index 0000000..d06305a --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_vlm.roof_shape_vlm.rst @@ -0,0 +1,7 @@ +brails.processors.roof\_shape\_vlm.roof\_shape\_vlm module +========================================================== + +.. automodule:: brails.processors.roof_shape_vlm.roof_shape_vlm + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.roof_shape_vlm.rst b/docs/rst-code/brails.processors.roof_shape_vlm.rst new file mode 100644 index 0000000..3f6d1ed --- /dev/null +++ b/docs/rst-code/brails.processors.roof_shape_vlm.rst @@ -0,0 +1,15 @@ +brails.processors.roof\_shape\_vlm package +========================================== + +.. automodule:: brails.processors.roof_shape_vlm + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.roof_shape_vlm.roof_shape_vlm diff --git a/docs/rst-code/brails.processors.rst b/docs/rst-code/brails.processors.rst new file mode 100644 index 0000000..45c84a8 --- /dev/null +++ b/docs/rst-code/brails.processors.rst @@ -0,0 +1,40 @@ +brails.processors package +========================= + +.. automodule:: brails.processors + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.FoundationClassifier + brails.processors.building_material_llm + brails.processors.cons_type_classifier + brails.processors.facade_parser + brails.processors.garage_detector + brails.processors.image_classifier + brails.processors.image_segmenter + brails.processors.nFloor_gpt + brails.processors.nFloor_vlm + brails.processors.nfloors_detector + brails.processors.occupancy_classifier + brails.processors.other_idea + brails.processors.roof_shape_classifier + brails.processors.roof_shape_gpt + brails.processors.roof_shape_vlm + brails.processors.vlm_image_classifier + brails.processors.vlm_segmenter + brails.processors.year_built_classifier + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.image_processor diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.CLIPClassifier.html b/docs/rst-code/brails.processors.vlm_image_classifier.CLIPClassifier.html new file mode 100644 index 0000000..8f1a691 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.CLIPClassifier.html @@ -0,0 +1,194 @@ + + + + + + + + + brails.processors.vlm_image_classifier.CLIPClassifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_image_classifier.CLIPClassifier module

+

Class object to call CLIP for image classification.

+
+
+class brails.processors.vlm_image_classifier.CLIPClassifier.CLIPClassifier(task: str, input_dict: dict | None = None)
+

Bases: object

+

A classifier that utilizes CLIP model to predict attributes from images.

+

This class is designed to load a CLIP model, process input images, +and make predictions for the entered textual prompts. It supports +customizable classes and prompts to enhance prediction accuracy.

+
+
Attributes__
+
model_arch (str): The architecture of the model to be used. Available

model architectures are ‘ViT-B/32’ (default), RN50’, ‘RN101’, +‘RN50x4’,’RN50x16’, ‘RN50x64’, ‘ViT-B/16’, ‘ViT-L/14’, and +‘ViT-L/14@336px’.

+
+
+

device (torch.device): The device (CPU or GPU) used for computations. +preds (Optional[Dict[str, str]]): A dictionary to hold predictions. +batch_size (int): The number of images processed in a single batch. +template (str): A template for formatting text prompts.

+
+
Args__

task (str): The task for which the classifier is being used. +input_dict (Optional[dict]): A dictionary containing model architecture

+
+

and other configuration parameters.

+
+
+
+
+
+predict(images: ImageSet, model_path: str = '', classes: List[str] | None = None, text_prompts: List[str] | None = None) Dict[str, str]
+

Predicts classes for the given images using the CLIP model.

+
+
Args__

images (ImageSet): An object containing the images to classify. +model_path (str): The path to the pre-trained model. +classes (Optional[List[str]]): A list of class names. +text_prompts (Optional[List[str]]): A list of text prompts

+
+

corresponding to the classes.

+
+
+
Returns__
+
Dict[str, str]: A dictionary mapping image keys to their predicted

classes.

+
+
+
+
Raises__
+
AssertionError: If the conditions on classes and text_prompts are

not met.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.CLIPClassifier.rst b/docs/rst-code/brails.processors.vlm_image_classifier.CLIPClassifier.rst new file mode 100644 index 0000000..766666e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.CLIPClassifier.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_image\_classifier.CLIPClassifier module +============================================================== + +.. automodule:: brails.processors.vlm_image_classifier.CLIPClassifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.clip.html b/docs/rst-code/brails.processors.vlm_image_classifier.clip.clip.html new file mode 100644 index 0000000..c96c143 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.clip.html @@ -0,0 +1,195 @@ + + + + + + + + + brails.processors.vlm_image_classifier.clip.clip module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_image_classifier.clip.clip module

+
+
+brails.processors.vlm_image_classifier.clip.clip.available_models() List[str]
+

Returns the names of available CLIP models

+
+ +
+
+brails.processors.vlm_image_classifier.clip.clip.load(name: str, device: str | device = 'cpu', jit: bool = False, download_root: str | None = None)
+

Load a CLIP model

+
+

Parameters

+
+
namestr

A model name listed by clip.available_models(), or the path to a model checkpoint containing the state_dict

+
+
deviceUnion[str, torch.device]

The device to put the loaded model

+
+
jitbool

Whether to load the optimized JIT model or more hackable non-JIT model (default).

+
+
download_root: str

path to download the model files; by default, it uses “~/.cache/clip”

+
+
+
+
+

Returns

+
+
modeltorch.nn.Module

The CLIP model

+
+
preprocessCallable[[PIL.Image], torch.Tensor]

A torchvision transform that converts a PIL image into a tensor that the returned model can take as its input

+
+
+
+
+ +
+
+brails.processors.vlm_image_classifier.clip.clip.tokenize(texts: str | List[str], context_length: int = 77, truncate: bool = False) IntTensor | LongTensor
+

Returns the tokenized representation of given input string(s)

+
+

Parameters

+
+
textsUnion[str, List[str]]

An input string or a list of input strings to tokenize

+
+
context_lengthint

The context length to use; all CLIP models use 77 as the context length

+
+
truncate: bool

Whether to truncate the text in case its encoding is longer than the context length

+
+
+
+
+

Returns

+

A two-dimensional tensor containing the resulting tokens, shape = [number of input strings, context_length]. +We return LongTensor when torch version is <1.8.0, since older index_select requires indices to be long.

+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.clip.rst b/docs/rst-code/brails.processors.vlm_image_classifier.clip.clip.rst new file mode 100644 index 0000000..c89b4e9 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.clip.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_image\_classifier.clip.clip module +========================================================= + +.. automodule:: brails.processors.vlm_image_classifier.clip.clip + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.html b/docs/rst-code/brails.processors.vlm_image_classifier.clip.html new file mode 100644 index 0000000..0267fc1 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.vlm_image_classifier.clip package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.model.html b/docs/rst-code/brails.processors.vlm_image_classifier.clip.model.html new file mode 100644 index 0000000..da390b8 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.model.html @@ -0,0 +1,375 @@ + + + + + + + + + brails.processors.vlm_image_classifier.clip.model module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_image_classifier.clip.model module

+
+
+class brails.processors.vlm_image_classifier.clip.model.AttentionPool2d(spacial_dim: int, embed_dim: int, num_heads: int, output_dim: int | None = None)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.Bottleneck(inplanes, planes, stride=1)
+

Bases: Module

+
+
+expansion = 4
+
+ +
+
+forward(x: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+training: bool
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.CLIP(embed_dim: int, image_resolution: int, vision_layers: Tuple[int, int, int, int] | int, vision_width: int, vision_patch_size: int, context_length: int, vocab_size: int, transformer_width: int, transformer_heads: int, transformer_layers: int)
+

Bases: Module

+
+
+build_attention_mask()
+
+ +
+
+property dtype
+
+ +
+
+encode_image(image)
+
+ +
+
+encode_text(text)
+
+ +
+
+forward(image, text)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+initialize_parameters()
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.LayerNorm(normalized_shape: int | List[int] | Size, eps: float = 1e-05, elementwise_affine: bool = True, bias: bool = True, device=None, dtype=None)
+

Bases: LayerNorm

+

Subclass torch’s LayerNorm to handle fp16.

+
+
+forward(x: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.ModifiedResNet(layers, output_dim, heads, input_resolution=224, width=64)
+

Bases: Module

+

A ResNet class that is similar to torchvision’s but contains the following changes: +- There are now 3 “stem” convolutions as opposed to 1, with an average pool instead of a max pool. +- Performs anti-aliasing strided convolutions, where an avgpool is prepended to convolutions with stride > 1 +- The final pooling layer is a QKV attention instead of an average pool

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.QuickGELU(*args, **kwargs)
+

Bases: Module

+
+
+forward(x: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.ResidualAttentionBlock(d_model: int, n_head: int, attn_mask: Tensor | None = None)
+

Bases: Module

+
+
+attention(x: Tensor)
+
+ +
+
+forward(x: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.Transformer(width: int, layers: int, heads: int, attn_mask: Tensor | None = None)
+

Bases: Module

+
+
+forward(x: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_image_classifier.clip.model.VisionTransformer(input_resolution: int, patch_size: int, width: int, layers: int, heads: int, output_dim: int)
+

Bases: Module

+
+
+forward(x: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.vlm_image_classifier.clip.model.build_model(state_dict: dict)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.model.convert_weights(model: Module)
+

Convert applicable model parameters to fp16

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.model.rst b/docs/rst-code/brails.processors.vlm_image_classifier.clip.model.rst new file mode 100644 index 0000000..e6ac905 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.model.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_image\_classifier.clip.model module +========================================================== + +.. automodule:: brails.processors.vlm_image_classifier.clip.model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.rst b/docs/rst-code/brails.processors.vlm_image_classifier.clip.rst new file mode 100644 index 0000000..09ab73d --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.rst @@ -0,0 +1,18 @@ +brails.processors.vlm\_image\_classifier.clip package +===================================================== + +.. automodule:: brails.processors.vlm_image_classifier.clip + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_image_classifier.clip.clip + brails.processors.vlm_image_classifier.clip.model + brails.processors.vlm_image_classifier.clip.simple_tokenizer + brails.processors.vlm_image_classifier.clip.utils diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.simple_tokenizer.html b/docs/rst-code/brails.processors.vlm_image_classifier.clip.simple_tokenizer.html new file mode 100644 index 0000000..8ed7542 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.simple_tokenizer.html @@ -0,0 +1,194 @@ + + + + + + + + + brails.processors.vlm_image_classifier.clip.simple_tokenizer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_image_classifier.clip.simple_tokenizer module

+
+
+class brails.processors.vlm_image_classifier.clip.simple_tokenizer.SimpleTokenizer(bpe_path: str = '/Users/fmckenna/NHERI/brailsPlusPlus/brails/processors/vlm_image_classifier/clip/bpe_simple_vocab_16e6.txt.gz')
+

Bases: object

+
+
+bpe(token)
+
+ +
+
+decode(tokens)
+
+ +
+
+encode(text)
+
+ +
+ +
+
+brails.processors.vlm_image_classifier.clip.simple_tokenizer.basic_clean(text)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.simple_tokenizer.bytes_to_unicode()
+

Returns list of utf-8 byte and a corresponding list of unicode strings. +The reversible bpe codes work on unicode strings. +This means you need a large # of unicode characters in your vocab if you want to avoid UNKs. +When you’re at something like a 10B token dataset you end up needing around 5K for decent coverage. +This is a significant percentage of your normal, say, 32K bpe vocab. +To avoid that, we want lookup tables between utf-8 bytes and unicode strings. +And avoids mapping to whitespace/control characters the bpe code barfs on.

+
+ +
+
+brails.processors.vlm_image_classifier.clip.simple_tokenizer.default_bpe()
+
+ +
+
+brails.processors.vlm_image_classifier.clip.simple_tokenizer.get_pairs(word)
+

Return set of symbol pairs in a word. +Word is represented as tuple of symbols (symbols being variable-length strings).

+
+ +
+
+brails.processors.vlm_image_classifier.clip.simple_tokenizer.whitespace_clean(text)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.simple_tokenizer.rst b/docs/rst-code/brails.processors.vlm_image_classifier.clip.simple_tokenizer.rst new file mode 100644 index 0000000..7a5a669 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.simple_tokenizer.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_image\_classifier.clip.simple\_tokenizer module +====================================================================== + +.. automodule:: brails.processors.vlm_image_classifier.clip.simple_tokenizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.utils.html b/docs/rst-code/brails.processors.vlm_image_classifier.clip.utils.html new file mode 100644 index 0000000..041b27f --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.utils.html @@ -0,0 +1,169 @@ + + + + + + + + + brails.processors.vlm_image_classifier.clip.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_image_classifier.clip.utils module

+
+
+brails.processors.vlm_image_classifier.clip.utils.aggregate_predictions(similarity, agg_method, gap)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.utils.compute_similarity(image_features, text_features)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.utils.pred_idx_to_labels(gt_labels, prediction_df)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.utils.predict_wrapper(model, text_input, img_paths, preprocess, device, batch_size=200, agg='max', num_classes=3)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.utils.preprocess_batch_img(batch_idx, batch_size, img_paths, aug, device)
+
+ +
+
+brails.processors.vlm_image_classifier.clip.utils.round(similarity, decimals)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.clip.utils.rst b/docs/rst-code/brails.processors.vlm_image_classifier.clip.utils.rst new file mode 100644 index 0000000..1966a57 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.clip.utils.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_image\_classifier.clip.utils module +========================================================== + +.. automodule:: brails.processors.vlm_image_classifier.clip.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.html b/docs/rst-code/brails.processors.vlm_image_classifier.html new file mode 100644 index 0000000..74ba141 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.html @@ -0,0 +1,153 @@ + + + + + + + + + brails.processors.vlm_image_classifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_image_classifier package

+
+

Subpackages

+ +
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_image_classifier.rst b/docs/rst-code/brails.processors.vlm_image_classifier.rst new file mode 100644 index 0000000..f700f2d --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_image_classifier.rst @@ -0,0 +1,23 @@ +brails.processors.vlm\_image\_classifier package +================================================ + +.. automodule:: brails.processors.vlm_image_classifier + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_image_classifier.clip + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_image_classifier.CLIPClassifier diff --git a/docs/rst-code/brails.processors.vlm_segmenter.grounded_sam_utils.html b/docs/rst-code/brails.processors.vlm_segmenter.grounded_sam_utils.html new file mode 100644 index 0000000..de986a8 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.grounded_sam_utils.html @@ -0,0 +1,241 @@ + + + + + + + + + brails.processors.vlm_segmenter.grounded_sam_utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.grounded_sam_utils module

+
+
+class brails.processors.vlm_segmenter.grounded_sam_utils.BoundingBox(xmin: int, ymin: int, xmax: int, ymax: int)
+

Bases: object

+
+
+xmax: int
+
+ +
+
+xmin: int
+
+ +
+
+property xyxy: List[float]
+
+ +
+
+ymax: int
+
+ +
+
+ymin: int
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.grounded_sam_utils.DetectionResult(score: float, label: str, box: brails.processors.vlm_segmenter.grounded_sam_utils.BoundingBox, mask: Optional[<built-in function array>] = None)
+

Bases: object

+
+
+box: BoundingBox
+
+ +
+
+classmethod from_dict(detection_dict: Dict) DetectionResult
+
+ +
+
+label: str
+
+ +
+
+mask: array | None = None
+
+ +
+
+score: float
+
+ +
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.build_models(device='cuda:0')
+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.detect(image: Image, labels: List[str], threshold: float = 0.3, detector_id: str | None = None) List[Dict[str, Any]]
+

Use Grounding DINO to detect a set of labels in an image in a zero-shot fashion.

+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.run_on_one_image(img_source, output_dir, grounding_dino_model, sam_predictor, CLASS_TO_CODE, BOX_THRESHOLD=0.35, TEXT_THRESHOLD=0.25, NMS_THRESHOLD=0.8, visualize=False)
+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.segment(sam_predictor: SamPredictor, image: ndarray, xyxy: ndarray) ndarray
+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.show_binary_mask(mask, ax, label_code)
+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.show_box(box, ax)
+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.show_points(coords, labels, ax, marker_size=375)
+
+ +
+
+brails.processors.vlm_segmenter.grounded_sam_utils.verify_and_download_models(download_url, filepath)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.grounded_sam_utils.rst b/docs/rst-code/brails.processors.vlm_segmenter.grounded_sam_utils.rst new file mode 100644 index 0000000..2e888e2 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.grounded_sam_utils.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.grounded\_sam\_utils module +============================================================ + +.. automodule:: brails.processors.vlm_segmenter.grounded_sam_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB.html new file mode 100644 index 0000000..93d92fd --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB.rst new file mode 100644 index 0000000..18ef686 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.config.GroundingDINO\_SwinB module +================================================================================= + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC.html new file mode 100644 index 0000000..9503ae9 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC.rst new file mode 100644 index 0000000..79fe342 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.config.GroundingDINO\_SwinT\_OGC module +====================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.html new file mode 100644 index 0000000..0399517 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.html @@ -0,0 +1,146 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.config package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.rst new file mode 100644 index 0000000..d89d79e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.config.rst @@ -0,0 +1,16 @@ +brails.processors.vlm\_segmenter.groundingdino.config package +============================================================= + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.config + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinB + brails.processors.vlm_segmenter.groundingdino.config.GroundingDINO_SwinT_OGC diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.html new file mode 100644 index 0000000..50f8084 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.html @@ -0,0 +1,163 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.datasets package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.rst new file mode 100644 index 0000000..7e5b718 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.rst @@ -0,0 +1,15 @@ +brails.processors.vlm\_segmenter.groundingdino.datasets package +=============================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.datasets + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.datasets.transforms diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.transforms.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.transforms.html new file mode 100644 index 0000000..ad13a0e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.transforms.html @@ -0,0 +1,233 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.datasets.transforms module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.datasets.transforms module

+

Transforms and data augmentation for both image + bbox.

+
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.CenterCrop(size)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.Compose(transforms)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.Normalize(mean, std)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomCrop(size)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomErasing(*args, **kwargs)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomHorizontalFlip(p=0.5)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomPad(max_pad)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomResize(sizes, max_size=None)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomSelect(transforms1, transforms2, p=0.5)
+

Bases: object

+

Randomly selects between transforms1 and transforms2, +with probability p for transforms1 and (1 - p) for transforms2

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.RandomSizeCrop(min_size: int, max_size: int, respect_boxes: bool = False)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.ResizeDebug(size)
+

Bases: object

+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.datasets.transforms.ToTensor
+

Bases: object

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.datasets.transforms.crop(image, target, region)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.datasets.transforms.hflip(image, target)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.datasets.transforms.pad(image, target, padding)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.datasets.transforms.resize(image, target, size, max_size=None)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.transforms.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.transforms.rst new file mode 100644 index 0000000..232c382 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.datasets.transforms.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.datasets.transforms module +========================================================================= + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.datasets.transforms + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.html new file mode 100644 index 0000000..6295d18 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.html @@ -0,0 +1,272 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino package

+
+

Subpackages

+
+ +
+
+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone.html new file mode 100644 index 0000000..0ec126b --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone.html @@ -0,0 +1,140 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone.rst new file mode 100644 index 0000000..c678e97 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.backbone.backbone module +============================================================================================ + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.html new file mode 100644 index 0000000..9b4a5fd --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.html @@ -0,0 +1,149 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding.html new file mode 100644 index 0000000..34ca449 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding.html @@ -0,0 +1,140 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding.rst new file mode 100644 index 0000000..1f30325 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.backbone.position\_encoding module +====================================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.rst new file mode 100644 index 0000000..587c649 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.rst @@ -0,0 +1,17 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.backbone package +==================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.backbone + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.position_encoding + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer.html new file mode 100644 index 0000000..b56b915 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer.html @@ -0,0 +1,140 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer.rst new file mode 100644 index 0000000..4401c00 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.backbone.swin\_transformer module +===================================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone.swin_transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper.html new file mode 100644 index 0000000..ccf64a6 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper.rst new file mode 100644 index 0000000..4b90b0e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.bertwarper module +===================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules.html new file mode 100644 index 0000000..f13ae13 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules.rst new file mode 100644 index 0000000..a862c40 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.fuse\_modules module +======================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino.html new file mode 100644 index 0000000..134a153 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino.rst new file mode 100644 index 0000000..59a232d --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.groundingdino module +======================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.html new file mode 100644 index 0000000..a1b8771 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.html @@ -0,0 +1,168 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn.html new file mode 100644 index 0000000..dcd91a5 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn.rst new file mode 100644 index 0000000..6387481 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.ms\_deform\_attn module +=========================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.rst new file mode 100644 index 0000000..d645b80 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.rst @@ -0,0 +1,29 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO package +=========================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.backbone + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.bertwarper + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.fuse_modules + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.groundingdino + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.ms_deform_attn + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer.html new file mode 100644 index 0000000..76b5b15 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer.rst new file mode 100644 index 0000000..6d6e9b9 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.transformer module +====================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla.html new file mode 100644 index 0000000..2accf04 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla.rst new file mode 100644 index 0000000..75a5f5c --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.transformer\_vanilla module +=============================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.transformer_vanilla + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils.html new file mode 100644 index 0000000..6c3454f --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils.html @@ -0,0 +1,139 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils.rst new file mode 100644 index 0000000..344807a --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.GroundingDINO.utils module +================================================================================ + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.html new file mode 100644 index 0000000..c104ac6 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.html @@ -0,0 +1,172 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.registry.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.registry.html new file mode 100644 index 0000000..ca6e19e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.registry.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.models.registry module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.models.registry module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.registry.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.registry.rst new file mode 100644 index 0000000..5b5ee0c --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.registry.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.models.registry module +===================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models.registry + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.rst new file mode 100644 index 0000000..ba44b12 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.models.rst @@ -0,0 +1,23 @@ +brails.processors.vlm\_segmenter.groundingdino.models package +============================================================= + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.models + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.models.GroundingDINO + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.models.registry diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.rst new file mode 100644 index 0000000..d9f8d15 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.rst @@ -0,0 +1,26 @@ +brails.processors.vlm\_segmenter.groundingdino package +====================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.config + brails.processors.vlm_segmenter.groundingdino.datasets + brails.processors.vlm_segmenter.groundingdino.models + brails.processors.vlm_segmenter.groundingdino.util + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.version diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.box_ops.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.box_ops.html new file mode 100644 index 0000000..a4a0b20 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.box_ops.html @@ -0,0 +1,192 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.box_ops module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.box_ops module

+

Utilities for bounding box manipulation and GIoU.

+
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.box_cxcywh_to_xyxy(x)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.box_iou(boxes1, boxes2)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.box_iou_pairwise(boxes1, boxes2)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.box_xyxy_to_cxcywh(x)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.generalized_box_iou(boxes1, boxes2)
+

Generalized IoU from https://giou.stanford.edu/

+

The boxes should be in [x0, y0, x1, y1] format

+

Returns a [N, M] pairwise matrix, where N = len(boxes1) +and M = len(boxes2)

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.generalized_box_iou_pairwise(boxes1, boxes2)
+

Generalized IoU from https://giou.stanford.edu/

+
+
Input:
    +
  • boxes1, boxes2: N,4

  • +
+
+
Output:
    +
  • giou: N, 4

  • +
+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.box_ops.masks_to_boxes(masks)
+

Compute the bounding boxes around the provided masks

+

The masks should be in format [N, H, W] where N is the number of masks, (H, W) are the spatial dimensions.

+

Returns a [N, 4] tensors, with the boxes in xyxy format

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.box_ops.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.box_ops.rst new file mode 100644 index 0000000..2d92be5 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.box_ops.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.box\_ops module +=================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.box_ops + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.html new file mode 100644 index 0000000..3dc37cb --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.html @@ -0,0 +1,148 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer module

+
+
+brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.get_pretrained_language_model(text_encoder_type)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.get_tokenlizer(text_encoder_type)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.rst new file mode 100644 index 0000000..89807b0 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.get\_tokenlizer module +========================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.html new file mode 100644 index 0000000..aecf8d4 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.html @@ -0,0 +1,271 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util package

+
+

Submodules

+
+ +
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.inference.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.inference.html new file mode 100644 index 0000000..cb95295 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.inference.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.inference module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.inference module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.inference.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.inference.rst new file mode 100644 index 0000000..c1b5de5 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.inference.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.inference module +==================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.inference + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.logger.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.logger.html new file mode 100644 index 0000000..ca260ce --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.logger.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.logger module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.logger module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.logger.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.logger.rst new file mode 100644 index 0000000..bbf9a74 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.logger.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.logger module +================================================================= + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.logger + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.misc.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.misc.html new file mode 100644 index 0000000..7ae7f8e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.misc.html @@ -0,0 +1,389 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.misc module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.misc module

+

Misc functions, including distributed helpers.

+

Mostly copy-paste from torchvision references.

+
+
+class brails.processors.vlm_segmenter.groundingdino.util.misc.MetricLogger(delimiter='\t')
+

Bases: object

+
+
+add_meter(name, meter)
+
+ +
+
+log_every(iterable, print_freq, header=None, logger=None)
+
+ +
+
+synchronize_between_processes()
+
+ +
+
+update(**kwargs)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.misc.NestedTensor(tensors, mask: Tensor | None)
+

Bases: object

+
+
+decompose()
+
+ +
+
+property device
+
+ +
+
+imgsize()
+
+ +
+
+property shape
+
+ +
+
+to(device: Device) NestedTensor
+
+ +
+
+to_img_list()
+

remove the padding and convert to img list

+
+
Returns:

[type]: [description]

+
+
+
+ +
+
+to_img_list_single(tensor, mask)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.misc.SmoothedValue(window_size=20, fmt=None)
+

Bases: object

+

Track a series of values and provide access to smoothed values over a +window or the global series average.

+
+
+property avg
+
+ +
+
+property global_avg
+
+ +
+
+property max
+
+ +
+
+property median
+
+ +
+
+synchronize_between_processes()
+

Warning: does not synchronize the deque!

+
+ +
+
+update(value, n=1)
+
+ +
+
+property value
+
+ +
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.accuracy(output, target, topk=(1,))
+

Computes the precision@k for the specified values of k

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.accuracy_onehot(pred, gt)
+

_summary_

+
+
Args:

pred (_type_): n, c +gt (_type_): n, c

+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.all_gather(data)
+

Run all_gather on arbitrary picklable data (not necessarily tensors) +Args:

+
+

data: any picklable object

+
+
+
Returns:

list[data]: list of data gathered from each rank

+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.all_gather_cpu(data)
+

Run all_gather on arbitrary picklable data (not necessarily tensors) +Args:

+
+

data: any picklable object

+
+
+
Returns:

list[data]: list of data gathered from each rank

+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.clean_state_dict(state_dict)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.collate_fn(batch)
+
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.misc.color_sys(num_colors)
+

Bases: object

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.get_rank()
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.get_sha()
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.get_world_size()
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.init_distributed_mode(args)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.interpolate(input: Tensor, size: List[int] | None = None, scale_factor: float | None = None, mode: str = 'nearest', align_corners: bool | None = None) Tensor
+

Equivalent to nn.functional.interpolate, but with support for empty batch sizes. +This will eventually be supported natively by PyTorch, and this +class can go away.

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.inverse_sigmoid(x, eps=0.001)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.is_dist_avail_and_initialized()
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.is_main_process()
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.nested_tensor_from_tensor_list(tensor_list: List[Tensor])
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.reduce_dict(input_dict, average=True)
+
+
Args:

input_dict (dict): all the values will be reduced +average (bool): whether to do average or sum

+
+
+

Reduce the values in the dictionary from all processes so that all processes +have the averaged results. Returns a dict with the same fields as +input_dict, after reduction.

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.save_on_master(*args, **kwargs)
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.misc.setup_for_distributed(is_master)
+

This function disables printing when not in master process

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.misc.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.misc.rst new file mode 100644 index 0000000..588d9d6 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.misc.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.misc module +=============================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.misc + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.rst new file mode 100644 index 0000000..6846344 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.rst @@ -0,0 +1,25 @@ +brails.processors.vlm\_segmenter.groundingdino.util package +=========================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino.util.box_ops + brails.processors.vlm_segmenter.groundingdino.util.get_tokenlizer + brails.processors.vlm_segmenter.groundingdino.util.inference + brails.processors.vlm_segmenter.groundingdino.util.logger + brails.processors.vlm_segmenter.groundingdino.util.misc + brails.processors.vlm_segmenter.groundingdino.util.slconfig + brails.processors.vlm_segmenter.groundingdino.util.slio + brails.processors.vlm_segmenter.groundingdino.util.time_counter + brails.processors.vlm_segmenter.groundingdino.util.utils + brails.processors.vlm_segmenter.groundingdino.util.visualizer + brails.processors.vlm_segmenter.groundingdino.util.vl_utils diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slconfig.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slconfig.html new file mode 100644 index 0000000..325b096 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slconfig.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.slconfig module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.slconfig module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slconfig.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slconfig.rst new file mode 100644 index 0000000..99e229d --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slconfig.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.slconfig module +=================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.slconfig + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slio.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slio.html new file mode 100644 index 0000000..4bbbd55 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slio.html @@ -0,0 +1,289 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.slio module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.slio module

+
+
+class brails.processors.vlm_segmenter.groundingdino.util.slio.BaseFileHandler
+

Bases: object

+
+
+abstract dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_path(obj, filepath, mode='w', **kwargs)
+
+ +
+
+abstract dump_to_str(obj, **kwargs)
+
+ +
+
+abstract load_from_fileobj(file, **kwargs)
+
+ +
+
+load_from_path(filepath, mode='r', **kwargs)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.slio.JsonHandler
+

Bases: BaseFileHandler

+
+
+dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_str(obj, **kwargs)
+
+ +
+
+load_from_fileobj(file)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.slio.PickleHandler
+

Bases: BaseFileHandler

+
+
+dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_path(obj, filepath, **kwargs)
+
+ +
+
+dump_to_str(obj, **kwargs)
+
+ +
+
+load_from_fileobj(file, **kwargs)
+
+ +
+
+load_from_path(filepath, **kwargs)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.slio.YamlHandler
+

Bases: BaseFileHandler

+
+
+dump_to_fileobj(obj, file, **kwargs)
+
+ +
+
+dump_to_str(obj, **kwargs)
+
+ +
+
+load_from_fileobj(file, **kwargs)
+
+ +
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.slio.is_str(x)
+

Whether the input is an string instance.

+

Note: This method is deprecated since python 2 is no longer supported.

+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.slio.sldump(obj, file=None, file_format=None, **kwargs)
+

Dump data to json/yaml/pickle strings or files.

+

This method provides a unified api for dumping data as strings or to files, +and also supports custom arguments for each file format.

+
+
Args:

obj (any): The python object to be dumped. +file (str or Path or file-like object, optional): If not

+
+

specified, then the object is dump to a str, otherwise to a file +specified by the filename or file-like object.

+
+

file_format (str, optional): Same as load().

+
+
Returns:

bool: True for success, False otherwise.

+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.slio.slload(file, file_format=None, **kwargs)
+

Load data from json/yaml/pickle files.

+

This method provides a unified api for loading data from serialized files.

+
+
Args:
+
file (str or Path or file-like object): Filename or a file-like

object.

+
+
file_format (str, optional): If not specified, the file format will be

inferred from the file extension, otherwise use the specified one. +Currently supported formats include "json", "yaml/yml" and +"pickle/pkl".

+
+
+
+
Returns:

The content from the file.

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slio.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slio.rst new file mode 100644 index 0000000..e157be9 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.slio.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.slio module +=============================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.slio + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.time_counter.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.time_counter.html new file mode 100644 index 0000000..c615299 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.time_counter.html @@ -0,0 +1,187 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.time_counter module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.time_counter module

+
+
+class brails.processors.vlm_segmenter.groundingdino.util.time_counter.AverageMeter(name, fmt=':f', val_only=False)
+

Bases: object

+

Computes and stores the average and current value

+
+
+reset()
+
+ +
+
+update(val, n=1)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.time_counter.TimeCounter
+

Bases: object

+
+
+clear()
+
+ +
+
+timeit(name)
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.groundingdino.util.time_counter.TimeHolder
+

Bases: object

+
+
+final_res()
+
+ +
+
+update(_timedict: dict)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.time_counter.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.time_counter.rst new file mode 100644 index 0000000..dbbcbe7 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.time_counter.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.time\_counter module +======================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.time_counter + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.utils.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.utils.html new file mode 100644 index 0000000..f821563 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.utils.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.utils module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.utils.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.utils.rst new file mode 100644 index 0000000..d0c4c08 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.utils.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.utils module +================================================================ + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.visualizer.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.visualizer.html new file mode 100644 index 0000000..d61e0bb --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.visualizer.html @@ -0,0 +1,138 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.visualizer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.visualizer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.visualizer.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.visualizer.rst new file mode 100644 index 0000000..67c4512 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.visualizer.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.visualizer module +===================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.visualizer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.vl_utils.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.vl_utils.html new file mode 100644 index 0000000..e59b0e5 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.vl_utils.html @@ -0,0 +1,192 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.util.vl_utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.util.vl_utils module

+
+
+brails.processors.vlm_segmenter.groundingdino.util.vl_utils.build_captions_and_token_span(cat_list, force_lowercase)
+
+
Return:

captions: str +cat2tokenspan: dict

+
+
+
{

'dog': [[0, 2]], +...

+
+
+

}

+
+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.vl_utils.build_id2posspan_and_caption(category_dict: dict)
+

Build id2pos_span and caption from category_dict

+
+
Args:

category_dict (dict): category_dict

+
+
+
+ +
+
+brails.processors.vlm_segmenter.groundingdino.util.vl_utils.create_positive_map_from_span(tokenized, token_span, max_text_len=256)
+

construct a map such that positive_map[i,j] = True iff box i is associated to token j +Input:

+
+
    +
  • +
    tokenized:
      +
    • input_ids: Tensor[1, ntokens]

    • +
    • attention_mask: Tensor[1, ntokens]

    • +
    +
    +
    +
  • +
  • +
    token_span: list with length num_boxes.
      +
    • each item: [start_idx, end_idx]

    • +
    +
    +
    +
  • +
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.vl_utils.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.vl_utils.rst new file mode 100644 index 0000000..b8e7e11 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.util.vl_utils.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.util.vl\_utils module +==================================================================== + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.util.vl_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.version.html b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.version.html new file mode 100644 index 0000000..656bef5 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.version.html @@ -0,0 +1,137 @@ + + + + + + + brails.processors.vlm_segmenter.groundingdino.version module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.groundingdino.version module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.version.rst b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.version.rst new file mode 100644 index 0000000..875f307 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.groundingdino.version.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.groundingdino.version module +============================================================= + +.. automodule:: brails.processors.vlm_segmenter.groundingdino.version + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.html b/docs/rst-code/brails.processors.vlm_segmenter.html new file mode 100644 index 0000000..10866d7 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.html @@ -0,0 +1,154 @@ + + + + + + + + + brails.processors.vlm_segmenter package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.rst b/docs/rst-code/brails.processors.vlm_segmenter.rst new file mode 100644 index 0000000..35ca7cd --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.rst @@ -0,0 +1,25 @@ +brails.processors.vlm\_segmenter package +======================================== + +.. automodule:: brails.processors.vlm_segmenter + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.groundingdino + brails.processors.vlm_segmenter.segment_anything + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.grounded_sam_utils + brails.processors.vlm_segmenter.vlm_segmenter diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.html new file mode 100644 index 0000000..a4ba6c2 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.html @@ -0,0 +1,190 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator module

+
+
+class brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.SamAutomaticMaskGenerator(model: Sam, points_per_side: int | None = 32, points_per_batch: int = 64, pred_iou_thresh: float = 0.88, stability_score_thresh: float = 0.95, stability_score_offset: float = 1.0, box_nms_thresh: float = 0.7, crop_n_layers: int = 0, crop_nms_thresh: float = 0.7, crop_overlap_ratio: float = 0.3413333333333333, crop_n_points_downscale_factor: int = 1, point_grids: List[ndarray] | None = None, min_mask_region_area: int = 0, output_mode: str = 'binary_mask')
+

Bases: object

+
+
+generate(image: ndarray) List[Dict[str, Any]]
+

Generates masks for the given image.

+
+
Arguments:

image (np.ndarray): The image to generate masks for, in HWC uint8 format.

+
+
Returns:
+
list(dict(str, any)): A list over records for masks. Each record is
+
a dict containing the following keys:
+
segmentation (dict(str, any) or np.ndarray): The mask. If

output_mode=’binary_mask’, is an array of shape HW. Otherwise, +is a dictionary containing the RLE.

+
+
+

bbox (list(float)): The box around the mask, in XYWH format. +area (int): The area in pixels of the mask. +predicted_iou (float): The model’s own prediction of the mask’s

+
+

quality. This is filtered by the pred_iou_thresh parameter.

+
+
+
point_coords (list(list(float))): The point coordinates input

to the model to generate this mask.

+
+
stability_score (float): A measure of the mask’s quality. This

is filtered on using the stability_score_thresh parameter.

+
+
crop_box (list(float)): The crop of the image used to generate

the mask, given in XYWH format.

+
+
+
+
+
+
+
+
+
+ +
+
+static postprocess_small_regions(mask_data: MaskData, min_area: int, nms_thresh: float) MaskData
+

Removes small disconnected regions and holes in masks, then reruns +box NMS to remove any new duplicates.

+

Edits mask_data in place.

+

Requires open-cv as a dependency.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.rst new file mode 100644 index 0000000..efba9d6 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.automatic\_mask\_generator module +==================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam.html new file mode 100644 index 0000000..db89d27 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam.html @@ -0,0 +1,159 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.build_sam module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.build_sam module

+
+
+brails.processors.vlm_segmenter.segment_anything.build_sam.build_sam(checkpoint=None)
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.build_sam.build_sam_vit_b(checkpoint=None)
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.build_sam.build_sam_vit_h(checkpoint=None)
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.build_sam.build_sam_vit_l(checkpoint=None)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam.rst new file mode 100644 index 0000000..424fb5e --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.build\_sam module +==================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.build_sam + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam_hq.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam_hq.html new file mode 100644 index 0000000..2ddc0b7 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam_hq.html @@ -0,0 +1,159 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.build_sam_hq module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.build_sam_hq module

+
+
+brails.processors.vlm_segmenter.segment_anything.build_sam_hq.build_sam_hq(checkpoint=None)
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.build_sam_hq.build_sam_hq_vit_b(checkpoint=None)
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.build_sam_hq.build_sam_hq_vit_h(checkpoint=None)
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.build_sam_hq.build_sam_hq_vit_l(checkpoint=None)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam_hq.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam_hq.rst new file mode 100644 index 0000000..ba6ea4a --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.build_sam_hq.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.build\_sam\_hq module +======================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.build_sam_hq + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.html new file mode 100644 index 0000000..cdbacf7 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.html @@ -0,0 +1,158 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.common.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.common.html new file mode 100644 index 0000000..c9c892a --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.common.html @@ -0,0 +1,180 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.common module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.common module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.common.LayerNorm2d(num_channels: int, eps: float = 1e-06)
+

Bases: Module

+
+
+forward(x: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.common.MLPBlock(embedding_dim: int, mlp_dim: int, act: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.GELU'>)
+

Bases: Module

+
+
+forward(x: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.common.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.common.rst new file mode 100644 index 0000000..1dfd7d1 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.common.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.common module +========================================================================= + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.common + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.html new file mode 100644 index 0000000..bd31bf8 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.html @@ -0,0 +1,153 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.html new file mode 100644 index 0000000..eea6685 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.html @@ -0,0 +1,291 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.Attention(dim: int, num_heads: int = 8, qkv_bias: bool = True, use_rel_pos: bool = False, rel_pos_zero_init: bool = True, input_size: Tuple[int, int] | None = None)
+

Bases: Module

+

Multi-head Attention block with relative position embeddings.

+
+
+forward(x: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.Block(dim: int, num_heads: int, mlp_ratio: float = 4.0, qkv_bias: bool = True, norm_layer: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.normalization.LayerNorm'>, act_layer: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.GELU'>, use_rel_pos: bool = False, rel_pos_zero_init: bool = True, window_size: int = 0, input_size: ~typing.Tuple[int, int] | None = None)
+

Bases: Module

+

Transformer blocks with support of window attention and residual propagation blocks

+
+
+forward(x: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.ImageEncoderViT(img_size: int = 1024, patch_size: int = 16, in_chans: int = 3, embed_dim: int = 768, depth: int = 12, num_heads: int = 12, mlp_ratio: float = 4.0, out_chans: int = 256, qkv_bias: bool = True, norm_layer: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.normalization.LayerNorm'>, act_layer: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.GELU'>, use_abs_pos: bool = True, use_rel_pos: bool = False, rel_pos_zero_init: bool = True, window_size: int = 0, global_attn_indexes: ~typing.Tuple[int, ...] = ())
+

Bases: Module

+
+
+forward(x: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.PatchEmbed(kernel_size: Tuple[int, int] = (16, 16), stride: Tuple[int, int] = (16, 16), padding: Tuple[int, int] = (0, 0), in_chans: int = 3, embed_dim: int = 768)
+

Bases: Module

+

Image to Patch Embedding.

+
+
+forward(x: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.add_decomposed_rel_pos(attn: Tensor, q: Tensor, rel_pos_h: Tensor, rel_pos_w: Tensor, q_size: Tuple[int, int], k_size: Tuple[int, int]) Tensor
+

Calculate decomposed Relative Positional Embeddings from :paper:`mvitv2`. +https://github.com/facebookresearch/mvit/blob/19786631e330df9f3622e5402b4a419a263a2c80/mvit/models/attention.py # noqa B950 +Args:

+
+

attn (Tensor): attention map. +q (Tensor): query q in the attention layer with shape (B, q_h * q_w, C). +rel_pos_h (Tensor): relative position embeddings (Lh, C) for height axis. +rel_pos_w (Tensor): relative position embeddings (Lw, C) for width axis. +q_size (Tuple): spatial sequence size of query q with (q_h, q_w). +k_size (Tuple): spatial sequence size of key k with (k_h, k_w).

+
+
+
Returns:

attn (Tensor): attention map with added relative positional embeddings.

+
+
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.get_rel_pos(q_size: int, k_size: int, rel_pos: Tensor) Tensor
+
+
Get relative positional embeddings according to the relative positions of

query and key sizes.

+
+
Args:

q_size (int): size of query q. +k_size (int): size of key k. +rel_pos (Tensor): relative position embeddings (L, C).

+
+
Returns:

Extracted positional embeddings according to relative positions.

+
+
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.window_partition(x: Tensor, window_size: int) Tuple[Tensor, Tuple[int, int]]
+

Partition into non-overlapping windows with padding if needed. +Args:

+
+

x (tensor): input tokens with [B, H, W, C]. +window_size (int): window size.

+
+
+
Returns:

windows: windows after partition with [B * num_windows, window_size, window_size, C]. +(Hp, Wp): padded height and width before partition

+
+
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.window_unpartition(windows: Tensor, window_size: int, pad_hw: Tuple[int, int], hw: Tuple[int, int]) Tensor
+

Window unpartition into original sequences and removing padding. +Args:

+
+

windows (tensor): input tokens with [B * num_windows, window_size, window_size, C]. +window_size (int): window size. +pad_hw (Tuple): padded height and width (Hp, Wp). +hw (Tuple): original height and width (H, W) before padding.

+
+
+
Returns:

x: unpartitioned sequences with [B, H, W, C].

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.rst new file mode 100644 index 0000000..66c194b --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.image\_encoder module +================================================================================= + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.html new file mode 100644 index 0000000..a502994 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.html @@ -0,0 +1,192 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.MLP(input_dim: int, hidden_dim: int, output_dim: int, num_layers: int, sigmoid_output: bool = False)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.MaskDecoder(*, transformer_dim: int, transformer: ~torch.nn.modules.module.Module, num_multimask_outputs: int = 3, activation: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.GELU'>, iou_head_depth: int = 3, iou_head_hidden_dim: int = 256)
+

Bases: Module

+
+
+forward(image_embeddings: Tensor, image_pe: Tensor, sparse_prompt_embeddings: Tensor, dense_prompt_embeddings: Tensor, multimask_output: bool, hq_token_only: bool, interm_embeddings: Tensor) Tuple[Tensor, Tensor]
+

Predict masks given image and prompt embeddings.

+
+
Arguments:

image_embeddings (torch.Tensor): the embeddings from the image encoder +image_pe (torch.Tensor): positional encoding with the shape of image_embeddings +sparse_prompt_embeddings (torch.Tensor): the embeddings of the points and boxes +dense_prompt_embeddings (torch.Tensor): the embeddings of the mask inputs +multimask_output (bool): Whether to return multiple masks or a single

+
+

mask.

+
+
+
Returns:

torch.Tensor: batched predicted masks +torch.Tensor: batched predictions of mask quality

+
+
+
+ +
+
+predict_masks(image_embeddings: Tensor, image_pe: Tensor, sparse_prompt_embeddings: Tensor, dense_prompt_embeddings: Tensor) Tuple[Tensor, Tensor]
+

Predicts masks. See ‘forward’ for more details.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.rst new file mode 100644 index 0000000..372dfa5 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.mask\_decoder module +================================================================================ + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.html new file mode 100644 index 0000000..5f973b6 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.html @@ -0,0 +1,192 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.MLP(input_dim: int, hidden_dim: int, output_dim: int, num_layers: int, sigmoid_output: bool = False)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.MaskDecoderHQ(*, transformer_dim: int, transformer: ~torch.nn.modules.module.Module, num_multimask_outputs: int = 3, activation: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.GELU'>, iou_head_depth: int = 3, iou_head_hidden_dim: int = 256, vit_dim: int = 1024)
+

Bases: Module

+
+
+forward(image_embeddings: Tensor, image_pe: Tensor, sparse_prompt_embeddings: Tensor, dense_prompt_embeddings: Tensor, multimask_output: bool, hq_token_only: bool, interm_embeddings: Tensor) Tuple[Tensor, Tensor]
+

Predict masks given image and prompt embeddings.

+
+
Arguments:

image_embeddings (torch.Tensor): the embeddings from the ViT image encoder +image_pe (torch.Tensor): positional encoding with the shape of image_embeddings +sparse_prompt_embeddings (torch.Tensor): the embeddings of the points and boxes +dense_prompt_embeddings (torch.Tensor): the embeddings of the mask inputs +multimask_output (bool): Whether to return multiple masks or a single

+
+

mask.

+
+
+
Returns:

torch.Tensor: batched predicted masks +torch.Tensor: batched predictions of mask quality

+
+
+
+ +
+
+predict_masks(image_embeddings: Tensor, image_pe: Tensor, sparse_prompt_embeddings: Tensor, dense_prompt_embeddings: Tensor, hq_features: Tensor) Tuple[Tensor, Tensor]
+

Predicts masks. See ‘forward’ for more details.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.rst new file mode 100644 index 0000000..3de9c58 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.mask\_decoder\_hq module +==================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.html new file mode 100644 index 0000000..b11c069 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.html @@ -0,0 +1,203 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.PositionEmbeddingRandom(num_pos_feats: int = 64, scale: float | None = None)
+

Bases: Module

+

Positional encoding using random spatial frequencies.

+
+
+forward(size: Tuple[int, int]) Tensor
+

Generate positional encoding for a grid of the specified size.

+
+ +
+
+forward_with_coords(coords_input: Tensor, image_size: Tuple[int, int]) Tensor
+

Positionally encode points that are not normalized to [0,1].

+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.PromptEncoder(embed_dim: int, image_embedding_size: ~typing.Tuple[int, int], input_image_size: ~typing.Tuple[int, int], mask_in_chans: int, activation: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.GELU'>)
+

Bases: Module

+
+
+forward(points: Tuple[Tensor, Tensor] | None, boxes: Tensor | None, masks: Tensor | None) Tuple[Tensor, Tensor]
+

Embeds different types of prompts, returning both sparse and dense +embeddings.

+
+
Arguments:
+
points (tuple(torch.Tensor, torch.Tensor) or none): point coordinates

and labels to embed.

+
+
+

boxes (torch.Tensor or none): boxes to embed +masks (torch.Tensor or none): masks to embed

+
+
Returns:
+
torch.Tensor: sparse embeddings for the points and boxes, with shape

BxNx(embed_dim), where N is determined by the number of input points +and boxes.

+
+
torch.Tensor: dense embeddings for the masks, in the shape

Bx(embed_dim)x(embed_H)x(embed_W)

+
+
+
+
+
+ +
+
+get_dense_pe() Tensor
+

Returns the positional encoding used to encode point prompts, +applied to a dense set of points the shape of the image encoding.

+
+
Returns:
+
torch.Tensor: Positional encoding with shape

1x(embed_dim)x(embedding_h)x(embedding_w)

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.rst new file mode 100644 index 0000000..681f469 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.prompt\_encoder module +================================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.rst new file mode 100644 index 0000000..631aabc --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.rst @@ -0,0 +1,21 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling package +=================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.segment_anything.modeling.common + brails.processors.vlm_segmenter.segment_anything.modeling.image_encoder + brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder + brails.processors.vlm_segmenter.segment_anything.modeling.mask_decoder_hq + brails.processors.vlm_segmenter.segment_anything.modeling.prompt_encoder + brails.processors.vlm_segmenter.segment_anything.modeling.sam + brails.processors.vlm_segmenter.segment_anything.modeling.transformer diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.sam.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.sam.html new file mode 100644 index 0000000..c5a1840 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.sam.html @@ -0,0 +1,247 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.sam module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.sam module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.sam.Sam(image_encoder: ImageEncoderViT, prompt_encoder: PromptEncoder, mask_decoder: MaskDecoder, pixel_mean: List[float] = [123.675, 116.28, 103.53], pixel_std: List[float] = [58.395, 57.12, 57.375])
+

Bases: Module

+
+
+property device: Any
+
+ +
+
+forward(batched_input: List[Dict[str, Any]], multimask_output: bool) List[Dict[str, Tensor]]
+

Predicts masks end-to-end from provided images and prompts. +If prompts are not known in advance, using SamPredictor is +recommended over calling the model directly.

+
+
Arguments:
+
batched_input (list(dict)): A list over input images, each a

dictionary with the following keys. A prompt key can be +excluded if it is not present.

+
+
+
‘image’: The image as a torch tensor in 3xHxW format,

already transformed for input to the model.

+
+
‘original_size’: (tuple(int, int)) The original size of

the image before transformation, as (H, W).

+
+
‘point_coords’: (torch.Tensor) Batched point prompts for

this image, with shape BxNx2. Already transformed to the +input frame of the model.

+
+
‘point_labels’: (torch.Tensor) Batched labels for point prompts,

with shape BxN.

+
+
‘boxes’: (torch.Tensor) Batched box inputs, with shape Bx4.

Already transformed to the input frame of the model.

+
+
‘mask_inputs’: (torch.Tensor) Batched mask inputs to the model,

in the form Bx1xHxW.

+
+
+
+
+
multimask_output (bool): Whether the model should predict multiple

disambiguating masks, or return a single mask.

+
+
+
+
Returns:
+
(list(dict)): A list over input images, where each element is
+
as dictionary with the following keys.
+
‘masks’: (torch.Tensor) Batched binary mask predictions,

with shape BxCxHxW, where B is the number of input prompts, +C is determiend by multimask_output, and (H, W) is the +original size of the image.

+
+
‘iou_predictions’: (torch.Tensor) The model’s predictions

of mask quality, in shape BxC.

+
+
‘low_res_logits’: (torch.Tensor) Low resolution logits with

shape BxCxHxW, where H=W=256. Can be passed as mask input +to subsequent iterations of prediction.

+
+
+
+
+
+
+
+
+
+ +
+
+image_format: str = 'RGB'
+
+ +
+
+mask_threshold: float = 0.0
+
+ +
+
+postprocess_masks(masks: Tensor, input_size: Tuple[int, ...], original_size: Tuple[int, ...]) Tensor
+

Remove padding and upscale masks to the original image size.

+
+
Arguments:
+
masks (torch.Tensor): Batched masks from the mask_decoder,

in BxCxHxW format.

+
+
input_size (tuple(int, int)): The size of the image input to the

model, in (H, W) format. Used to remove padding.

+
+
original_size (tuple(int, int)): The original size of the image

before resizing for input to the model, in (H, W) format.

+
+
+
+
Returns:
+
(torch.Tensor): Batched masks in BxCxHxW format, where (H, W)

is given by original_size.

+
+
+
+
+
+ +
+
+preprocess(x: Tensor) Tensor
+

Normalize pixel values and pad to a square input.

+
+ +
+
+training: bool
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.sam.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.sam.rst new file mode 100644 index 0000000..962aea6 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.sam.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.sam module +====================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.sam + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.transformer.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.transformer.html new file mode 100644 index 0000000..5b42ada --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.transformer.html @@ -0,0 +1,207 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.modeling.transformer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.modeling.transformer module

+
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.transformer.Attention(embedding_dim: int, num_heads: int, downsample_rate: int = 1)
+

Bases: Module

+

An attention layer that allows for downscaling the size of the embedding +after projection to queries, keys, and values.

+
+
+forward(q: Tensor, k: Tensor, v: Tensor) Tensor
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.transformer.TwoWayAttentionBlock(embedding_dim: int, num_heads: int, mlp_dim: int = 2048, activation: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.ReLU'>, attention_downsample_rate: int = 2, skip_first_layer_pe: bool = False)
+

Bases: Module

+
+
+forward(queries: Tensor, keys: Tensor, query_pe: Tensor, key_pe: Tensor) Tuple[Tensor, Tensor]
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.vlm_segmenter.segment_anything.modeling.transformer.TwoWayTransformer(depth: int, embedding_dim: int, num_heads: int, mlp_dim: int, activation: ~typing.Type[~torch.nn.modules.module.Module] = <class 'torch.nn.modules.activation.ReLU'>, attention_downsample_rate: int = 2)
+

Bases: Module

+
+
+forward(image_embedding: Tensor, image_pe: Tensor, point_embedding: Tensor) Tuple[Tensor, Tensor]
+
+
Args:
+
image_embedding (torch.Tensor): image to attend to. Should be shape

B x embedding_dim x h x w for any h and w.

+
+
image_pe (torch.Tensor): the positional encoding to add to the image. Must

have the same shape as image_embedding.

+
+
point_embedding (torch.Tensor): the embedding to add to the query points.

Must have shape B x N_points x embedding_dim for any N_points.

+
+
+
+
Returns:

torch.Tensor: the processed point_embedding +torch.Tensor: the processed image_embedding

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.transformer.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.transformer.rst new file mode 100644 index 0000000..6bcab17 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.modeling.transformer.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.modeling.transformer module +============================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.modeling.transformer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.predictor.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.predictor.html new file mode 100644 index 0000000..5113e17 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.predictor.html @@ -0,0 +1,277 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.predictor module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.predictor module

+
+
+class brails.processors.vlm_segmenter.segment_anything.predictor.SamPredictor(sam_model: Sam)
+

Bases: object

+
+
+property device: device
+
+ +
+
+get_image_embedding() Tensor
+

Returns the image embeddings for the currently set image, with +shape 1xCxHxW, where C is the embedding dimension and (H,W) are +the embedding spatial dimension of SAM (typically C=256, H=W=64).

+
+ +
+
+predict(point_coords: ndarray | None = None, point_labels: ndarray | None = None, box: ndarray | None = None, mask_input: ndarray | None = None, multimask_output: bool = True, return_logits: bool = False, hq_token_only: bool = False) Tuple[ndarray, ndarray, ndarray]
+

Predict masks for the given input prompts, using the currently set image.

+
+
Arguments:
+
point_coords (np.ndarray or None): A Nx2 array of point prompts to the

model. Each point is in (X,Y) in pixels.

+
+
point_labels (np.ndarray or None): A length N array of labels for the

point prompts. 1 indicates a foreground point and 0 indicates a +background point.

+
+
box (np.ndarray or None): A length 4 array given a box prompt to the

model, in XYXY format.

+
+
mask_input (np.ndarray): A low resolution mask input to the model, typically

coming from a previous prediction iteration. Has form 1xHxW, where +for SAM, H=W=256.

+
+
multimask_output (bool): If true, the model will return three masks.

For ambiguous input prompts (such as a single click), this will often +produce better masks than a single prediction. If only a single +mask is needed, the model’s predicted quality score can be used +to select the best mask. For non-ambiguous prompts, such as multiple +input prompts, multimask_output=False can give better results.

+
+
return_logits (bool): If true, returns un-thresholded masks logits

instead of a binary mask.

+
+
+
+
Returns:
+
(np.ndarray): The output masks in CxHxW format, where C is the

number of masks, and (H, W) is the original image size.

+
+
(np.ndarray): An array of length C containing the model’s

predictions for the quality of each mask.

+
+
(np.ndarray): An array of shape CxHxW, where C is the number

of masks and H=W=256. These low resolution logits can be passed to +a subsequent iteration as mask input.

+
+
+
+
+
+ +
+
+predict_torch(point_coords: Tensor | None, point_labels: Tensor | None, boxes: Tensor | None = None, mask_input: Tensor | None = None, multimask_output: bool = True, return_logits: bool = False, hq_token_only: bool = False) Tuple[Tensor, Tensor, Tensor]
+

Predict masks for the given input prompts, using the currently set image. +Input prompts are batched torch tensors and are expected to already be +transformed to the input frame using ResizeLongestSide.

+
+
Arguments:
+
point_coords (torch.Tensor or None): A BxNx2 array of point prompts to the

model. Each point is in (X,Y) in pixels.

+
+
point_labels (torch.Tensor or None): A BxN array of labels for the

point prompts. 1 indicates a foreground point and 0 indicates a +background point.

+
+
boxes (np.ndarray or None): A Bx4 array given a box prompt to the

model, in XYXY format.

+
+
mask_input (np.ndarray): A low resolution mask input to the model, typically

coming from a previous prediction iteration. Has form Bx1xHxW, where +for SAM, H=W=256. Masks returned by a previous iteration of the +predict method do not need further transformation.

+
+
multimask_output (bool): If true, the model will return three masks.

For ambiguous input prompts (such as a single click), this will often +produce better masks than a single prediction. If only a single +mask is needed, the model’s predicted quality score can be used +to select the best mask. For non-ambiguous prompts, such as multiple +input prompts, multimask_output=False can give better results.

+
+
return_logits (bool): If true, returns un-thresholded masks logits

instead of a binary mask.

+
+
+
+
Returns:
+
(torch.Tensor): The output masks in BxCxHxW format, where C is the

number of masks, and (H, W) is the original image size.

+
+
(torch.Tensor): An array of shape BxC containing the model’s

predictions for the quality of each mask.

+
+
(torch.Tensor): An array of shape BxCxHxW, where C is the number

of masks and H=W=256. These low res logits can be passed to +a subsequent iteration as mask input.

+
+
+
+
+
+ +
+
+reset_image() None
+

Resets the currently set image.

+
+ +
+
+set_image(image: ndarray, image_format: str = 'RGB') None
+

Calculates the image embeddings for the provided image, allowing +masks to be predicted with the ‘predict’ method.

+
+
Arguments:
+
image (np.ndarray): The image for calculating masks. Expects an

image in HWC uint8 format, with pixel values in [0, 255].

+
+
+

image_format (str): The color format of the image, in [‘RGB’, ‘BGR’].

+
+
+
+ +
+
+set_torch_image(transformed_image: Tensor, original_image_size: Tuple[int, ...]) None
+

Calculates the image embeddings for the provided image, allowing +masks to be predicted with the ‘predict’ method. Expects the input +image to be already transformed to the format expected by the model.

+
+
Arguments:
+
transformed_image (torch.Tensor): The input image, with shape

1x3xHxW, which has been transformed with ResizeLongestSide.

+
+
original_image_size (tuple(int, int)): The size of the image

before transformation, in (H, W) format.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.predictor.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.predictor.rst new file mode 100644 index 0000000..2dc0d99 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.predictor.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.predictor module +=================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.predictor + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.rst new file mode 100644 index 0000000..19ea7ac --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.rst @@ -0,0 +1,27 @@ +brails.processors.vlm\_segmenter.segment\_anything package +========================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.segment_anything.modeling + brails.processors.vlm_segmenter.segment_anything.utils + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.segment_anything.automatic_mask_generator + brails.processors.vlm_segmenter.segment_anything.build_sam + brails.processors.vlm_segmenter.segment_anything.build_sam_hq + brails.processors.vlm_segmenter.segment_anything.predictor diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.amg.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.amg.html new file mode 100644 index 0000000..748ec06 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.amg.html @@ -0,0 +1,263 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.utils.amg module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.utils.amg module

+
+
+class brails.processors.vlm_segmenter.segment_anything.utils.amg.MaskData(**kwargs)
+

Bases: object

+

A structure for storing masks and their related data in batched format. +Implements basic filtering and concatenation.

+
+
+cat(new_stats: MaskData) None
+
+ +
+
+filter(keep: Tensor) None
+
+ +
+
+items() ItemsView[str, Any]
+
+ +
+
+to_numpy() None
+
+ +
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.area_from_rle(rle: Dict[str, Any]) int
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.batch_iterator(batch_size: int, *args) Generator[List[Any], None, None]
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.batched_mask_to_box(masks: Tensor) Tensor
+

Calculates boxes in XYXY format around masks. Return [0,0,0,0] for +an empty mask. For input shape C1xC2x…xHxW, the output shape is C1xC2x…x4.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.box_xyxy_to_xywh(box_xyxy: Tensor) Tensor
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.build_all_layer_point_grids(n_per_side: int, n_layers: int, scale_per_layer: int) List[ndarray]
+

Generates point grids for all crop layers.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.build_point_grid(n_per_side: int) ndarray
+

Generates a 2D grid of points evenly spaced in [0,1]x[0,1].

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.calculate_stability_score(masks: Tensor, mask_threshold: float, threshold_offset: float) Tensor
+

Computes the stability score for a batch of masks. The stability +score is the IoU between the binary masks obtained by thresholding +the predicted mask logits at high and low values.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.coco_encode_rle(uncompressed_rle: Dict[str, Any]) Dict[str, Any]
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.generate_crop_boxes(im_size: Tuple[int, ...], n_layers: int, overlap_ratio: float) Tuple[List[List[int]], List[int]]
+

Generates a list of crop boxes of different sizes. Each layer +has (2**i)**2 boxes for the ith layer.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.is_box_near_crop_edge(boxes: Tensor, crop_box: List[int], orig_box: List[int], atol: float = 20.0) Tensor
+

Filter masks at the edge of a crop, but not at the edge of the original image.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.mask_to_rle_pytorch(tensor: Tensor) List[Dict[str, Any]]
+

Encodes masks to an uncompressed RLE, in the format expected by +pycoco tools.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.remove_small_regions(mask: ndarray, area_thresh: float, mode: str) Tuple[ndarray, bool]
+

Removes small disconnected regions and holes in a mask. Returns the +mask and an indicator of if the mask has been modified.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.rle_to_mask(rle: Dict[str, Any]) ndarray
+

Compute a binary mask from an uncompressed RLE.

+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.uncrop_boxes_xyxy(boxes: Tensor, crop_box: List[int]) Tensor
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.uncrop_masks(masks: Tensor, crop_box: List[int], orig_h: int, orig_w: int) Tensor
+
+ +
+
+brails.processors.vlm_segmenter.segment_anything.utils.amg.uncrop_points(points: Tensor, crop_box: List[int]) Tensor
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.amg.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.amg.rst new file mode 100644 index 0000000..a9dbe81 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.amg.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.utils.amg module +=================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.utils.amg + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.html new file mode 100644 index 0000000..d4202cf --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.html @@ -0,0 +1,149 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.onnx.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.onnx.html new file mode 100644 index 0000000..c20480c --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.onnx.html @@ -0,0 +1,179 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.utils.onnx module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.utils.onnx module

+
+
+class brails.processors.vlm_segmenter.segment_anything.utils.onnx.SamOnnxModel(model: Sam, return_single_mask: bool, use_stability_score: bool = False, return_extra_metrics: bool = False)
+

Bases: Module

+

This model should not be called directly, but is used in ONNX export. +It combines the prompt encoder, mask decoder, and mask postprocessing of Sam, +with some functions modified to enable model tracing. Also supports extra +options controlling what information. See the ONNX export script for details.

+
+
+forward(image_embeddings: Tensor, point_coords: Tensor, point_labels: Tensor, mask_input: Tensor, has_mask_input: Tensor, orig_im_size: Tensor)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+
+mask_postprocessing(masks: Tensor, orig_im_size: Tensor) Tensor
+
+ +
+
+static resize_longest_image_size(input_image_size: Tensor, longest_side: int) Tensor
+
+ +
+
+select_masks(masks: Tensor, iou_preds: Tensor, num_points: int) Tuple[Tensor, Tensor]
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.onnx.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.onnx.rst new file mode 100644 index 0000000..f029229 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.onnx.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.utils.onnx module +==================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.utils.onnx + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.rst new file mode 100644 index 0000000..1007134 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.rst @@ -0,0 +1,17 @@ +brails.processors.vlm\_segmenter.segment\_anything.utils package +================================================================ + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.utils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.vlm_segmenter.segment_anything.utils.amg + brails.processors.vlm_segmenter.segment_anything.utils.onnx + brails.processors.vlm_segmenter.segment_anything.utils.transforms diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.transforms.html b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.transforms.html new file mode 100644 index 0000000..39b7bfd --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.transforms.html @@ -0,0 +1,197 @@ + + + + + + + + + brails.processors.vlm_segmenter.segment_anything.utils.transforms module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.segment_anything.utils.transforms module

+
+
+class brails.processors.vlm_segmenter.segment_anything.utils.transforms.ResizeLongestSide(target_length: int)
+

Bases: object

+

Resizes images to longest side ‘target_length’, as well as provides +methods for resizing coordinates and boxes. Provides methods for +transforming both numpy array and batched torch tensors.

+
+
+apply_boxes(boxes: ndarray, original_size: Tuple[int, ...]) ndarray
+

Expects a numpy array shape Bx4. Requires the original image size +in (H, W) format.

+
+ +
+
+apply_boxes_torch(boxes: Tensor, original_size: Tuple[int, ...]) Tensor
+

Expects a torch tensor with shape Bx4. Requires the original image +size in (H, W) format.

+
+ +
+
+apply_coords(coords: ndarray, original_size: Tuple[int, ...]) ndarray
+

Expects a numpy array of length 2 in the final dimension. Requires the +original image size in (H, W) format.

+
+ +
+
+apply_coords_torch(coords: Tensor, original_size: Tuple[int, ...]) Tensor
+

Expects a torch tensor with length 2 in the last dimension. Requires the +original image size in (H, W) format.

+
+ +
+
+apply_image(image: ndarray) ndarray
+

Expects a numpy array with shape HxWxC in uint8 format.

+
+ +
+
+apply_image_torch(image: Tensor) Tensor
+

Expects batched images with shape BxCxHxW and float format. This +transformation may not exactly match apply_image. apply_image is +the transformation expected by the model.

+
+ +
+
+static get_preprocess_shape(oldh: int, oldw: int, long_side_length: int) Tuple[int, int]
+

Compute the output size given input size and target long side length.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.transforms.rst b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.transforms.rst new file mode 100644 index 0000000..0539ca3 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.segment_anything.utils.transforms.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.segment\_anything.utils.transforms module +========================================================================== + +.. automodule:: brails.processors.vlm_segmenter.segment_anything.utils.transforms + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.vlm_segmenter.vlm_segmenter.html b/docs/rst-code/brails.processors.vlm_segmenter.vlm_segmenter.html new file mode 100644 index 0000000..7fa2fc0 --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.vlm_segmenter.html @@ -0,0 +1,161 @@ + + + + + + + + + brails.processors.vlm_segmenter.vlm_segmenter module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.vlm_segmenter.vlm_segmenter module

+
+
+class brails.processors.vlm_segmenter.vlm_segmenter.VLMSegmenter(input_dict: dict | None = None)
+

Bases: object

+
+
+predict(images: ImageSet, modelPath=None, classes=None, output_dir='tmp/images/street', visualize=True)
+

The method predicts the stuff

+
+
Args

images: ImageSet The set of images for which a prediction is required

+
+
Return

saved_paths: paths to the saved masks

+
+
+
+ +
+
+write_dict(d, output_path)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.vlm_segmenter.vlm_segmenter.rst b/docs/rst-code/brails.processors.vlm_segmenter.vlm_segmenter.rst new file mode 100644 index 0000000..8148fcf --- /dev/null +++ b/docs/rst-code/brails.processors.vlm_segmenter.vlm_segmenter.rst @@ -0,0 +1,7 @@ +brails.processors.vlm\_segmenter.vlm\_segmenter module +====================================================== + +.. automodule:: brails.processors.vlm_segmenter.vlm_segmenter + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.Resnet.html b/docs/rst-code/brails.processors.year_built_classifier.Resnet.html new file mode 100644 index 0000000..34c7cbc --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.Resnet.html @@ -0,0 +1,223 @@ + + + + + + + + + brails.processors.year_built_classifier.Resnet module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.Resnet module

+
+
+class brails.processors.year_built_classifier.Resnet.ResNet(block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+brails.processors.year_built_classifier.Resnet.resnet101(pretrained=False, progress=True, **kwargs)
+

Constructs a ResNet-101 model. +Args:

+
+

pretrained (bool): If True, returns a model pre-trained on ImageNet +progress (bool): If True, displays a progress bar of the download to stderr

+
+
+ +
+
+brails.processors.year_built_classifier.Resnet.resnet152(pretrained=False, progress=True, **kwargs)
+

Constructs a ResNet-152 model. +Args:

+
+

pretrained (bool): If True, returns a model pre-trained on ImageNet +progress (bool): If True, displays a progress bar of the download to stderr

+
+
+ +
+
+brails.processors.year_built_classifier.Resnet.resnet18(pretrained=False, progress=True, **kwargs)
+

Constructs a ResNet-18 model. +Args:

+
+

pretrained (bool): If True, returns a model pre-trained on ImageNet +progress (bool): If True, displays a progress bar of the download to stderr

+
+
+ +
+
+brails.processors.year_built_classifier.Resnet.resnet34(pretrained=False, progress=True, **kwargs)
+

Constructs a ResNet-34 model. +Args:

+
+

pretrained (bool): If True, returns a model pre-trained on ImageNet +progress (bool): If True, displays a progress bar of the download to stderr

+
+
+ +
+
+brails.processors.year_built_classifier.Resnet.resnet50(pretrained=False, progress=True, **kwargs)
+

Constructs a ResNet-50 model. +Args:

+
+

pretrained (bool): If True, returns a model pre-trained on ImageNet +progress (bool): If True, displays a progress bar of the download to stderr

+
+
+ +
+
+brails.processors.year_built_classifier.Resnet.resnext101_32x8d(**kwargs)
+
+ +
+
+brails.processors.year_built_classifier.Resnet.resnext50_32x4d(**kwargs)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.Resnet.rst b/docs/rst-code/brails.processors.year_built_classifier.Resnet.rst new file mode 100644 index 0000000..569b7c2 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.Resnet.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.Resnet module +======================================================= + +.. automodule:: brails.processors.year_built_classifier.Resnet + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.YearBuiltClassifier.html b/docs/rst-code/brails.processors.year_built_classifier.YearBuiltClassifier.html new file mode 100644 index 0000000..42b6184 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.YearBuiltClassifier.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.processors.year_built_classifier.YearBuiltClassifier module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.YearBuiltClassifier module

+
+
+class brails.processors.year_built_classifier.YearBuiltClassifier.YearBuiltClassifier(checkpoint='', onlycpu=False, workDir='tmp', printRes=False)
+

Bases: object

+
+
+construct_confusion_matrix_image(con_mat)
+
+ +
+
+evaluate_to_stats(testloader)
+
+ +
+
+predict(image='')
+

image (str): Path to one image or a folder containing images.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.YearBuiltClassifier.rst b/docs/rst-code/brails.processors.year_built_classifier.YearBuiltClassifier.rst new file mode 100644 index 0000000..a98b691 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.YearBuiltClassifier.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.YearBuiltClassifier module +==================================================================== + +.. automodule:: brails.processors.year_built_classifier.YearBuiltClassifier + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.detect.html b/docs/rst-code/brails.processors.year_built_classifier.detect.html new file mode 100644 index 0000000..2ff89ab --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.detect.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.year_built_classifier.detect module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.detect module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.detect.rst b/docs/rst-code/brails.processors.year_built_classifier.detect.rst new file mode 100644 index 0000000..06590e5 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.detect.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.detect module +======================================================= + +.. automodule:: brails.processors.year_built_classifier.detect + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.html b/docs/rst-code/brails.processors.year_built_classifier.html new file mode 100644 index 0000000..050d4e5 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.html @@ -0,0 +1,158 @@ + + + + + + + + + brails.processors.year_built_classifier package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.lib.datasets.html b/docs/rst-code/brails.processors.year_built_classifier.lib.datasets.html new file mode 100644 index 0000000..4cd0607 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.lib.datasets.html @@ -0,0 +1,168 @@ + + + + + + + + + brails.processors.year_built_classifier.lib.datasets module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.lib.datasets module

+
+
+class brails.processors.year_built_classifier.lib.datasets.YearBuiltFolder(image_folder, soft_labels=False, gaussian_std=1.5, transforms=None, classes=None, calc_perf=False)
+

Bases: Dataset

+
+
+loader(path)
+
+ +
+
+soft_labels
+
+
if not os.path.isdir(image_folder):
+
if os.path.isfile(image_folder):

# The following format is to be consistent with os.walk output +file_list = [[os.path.split(image_folder)[0],’None’,[os.path.split(image_folder)[1]]]]

+
+
else:

print(‘Error: Image folder or file {} not found.’.format(image_folder)) +exit()

+
+
+
+
else:

file_list = os.walk(image_folder, followlinks=True)

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.lib.datasets.rst b/docs/rst-code/brails.processors.year_built_classifier.lib.datasets.rst new file mode 100644 index 0000000..84e1a5a --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.lib.datasets.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.lib.datasets module +============================================================= + +.. automodule:: brails.processors.year_built_classifier.lib.datasets + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.lib.html b/docs/rst-code/brails.processors.year_built_classifier.lib.html new file mode 100644 index 0000000..f29d1d0 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.lib.html @@ -0,0 +1,147 @@ + + + + + + + + + brails.processors.year_built_classifier.lib package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.lib package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.lib.rst b/docs/rst-code/brails.processors.year_built_classifier.lib.rst new file mode 100644 index 0000000..52d2125 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.lib.rst @@ -0,0 +1,16 @@ +brails.processors.year\_built\_classifier.lib package +===================================================== + +.. automodule:: brails.processors.year_built_classifier.lib + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.year_built_classifier.lib.datasets + brails.processors.year_built_classifier.lib.utils diff --git a/docs/rst-code/brails.processors.year_built_classifier.lib.utils.html b/docs/rst-code/brails.processors.year_built_classifier.lib.utils.html new file mode 100644 index 0000000..cfcf64a --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.lib.utils.html @@ -0,0 +1,174 @@ + + + + + + + + + brails.processors.year_built_classifier.lib.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.lib.utils module

+
+
+brails.processors.year_built_classifier.lib.utils.construct_confusion_matrix_image(classes, con_mat)
+
+ +
+
+brails.processors.year_built_classifier.lib.utils.cosine_anneal_schedule(t, nb_epoch, lr)
+
+ +
+
+brails.processors.year_built_classifier.lib.utils.jigsaw_generator(images, n)
+
+ +
+
+brails.processors.year_built_classifier.lib.utils.load_model(model_name, num_classes, pretrain=True, require_grad=True)
+
+ +
+
+brails.processors.year_built_classifier.lib.utils.model_info(model)
+
+ +
+
+brails.processors.year_built_classifier.lib.utils.test(net, criterion, testloader)
+
+ +
+
+brails.processors.year_built_classifier.lib.utils.test_softlabels(net, criterion, testloader)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.lib.utils.rst b/docs/rst-code/brails.processors.year_built_classifier.lib.utils.rst new file mode 100644 index 0000000..fd3eed9 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.lib.utils.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.lib.utils module +========================================================== + +.. automodule:: brails.processors.year_built_classifier.lib.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.model.html b/docs/rst-code/brails.processors.year_built_classifier.model.html new file mode 100644 index 0000000..a03a320 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.model.html @@ -0,0 +1,178 @@ + + + + + + + + + brails.processors.year_built_classifier.model module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.model module

+
+
+class brails.processors.year_built_classifier.model.BasicConv(in_planes, out_planes, kernel_size, stride=1, padding=0, dilation=1, groups=1, relu=True, bn=True, bias=False)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+
+class brails.processors.year_built_classifier.model.PMG(model, feature_size, classes_num)
+

Bases: Module

+
+
+forward(x)
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.model.rst b/docs/rst-code/brails.processors.year_built_classifier.model.rst new file mode 100644 index 0000000..8681196 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.model.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.model module +====================================================== + +.. automodule:: brails.processors.year_built_classifier.model + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.rst b/docs/rst-code/brails.processors.year_built_classifier.rst new file mode 100644 index 0000000..38192a6 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.rst @@ -0,0 +1,28 @@ +brails.processors.year\_built\_classifier package +================================================= + +.. automodule:: brails.processors.year_built_classifier + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.year_built_classifier.lib + brails.processors.year_built_classifier.weights + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.processors.year_built_classifier.Resnet + brails.processors.year_built_classifier.YearBuiltClassifier + brails.processors.year_built_classifier.detect + brails.processors.year_built_classifier.model + brails.processors.year_built_classifier.train diff --git a/docs/rst-code/brails.processors.year_built_classifier.train.html b/docs/rst-code/brails.processors.year_built_classifier.train.html new file mode 100644 index 0000000..6f5a6e4 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.train.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.year_built_classifier.train module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.train module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.train.rst b/docs/rst-code/brails.processors.year_built_classifier.train.rst new file mode 100644 index 0000000..be2a406 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.train.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.train module +====================================================== + +.. automodule:: brails.processors.year_built_classifier.train + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.processors.year_built_classifier.weights.html b/docs/rst-code/brails.processors.year_built_classifier.weights.html new file mode 100644 index 0000000..6d22193 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.weights.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.processors.year_built_classifier.weights package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.processors.year_built_classifier.weights package

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.processors.year_built_classifier.weights.rst b/docs/rst-code/brails.processors.year_built_classifier.weights.rst new file mode 100644 index 0000000..6aa03b1 --- /dev/null +++ b/docs/rst-code/brails.processors.year_built_classifier.weights.rst @@ -0,0 +1,7 @@ +brails.processors.year\_built\_classifier.weights package +========================================================= + +.. automodule:: brails.processors.year_built_classifier.weights + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.rst b/docs/rst-code/brails.rst new file mode 100644 index 0000000..cbb3a1a --- /dev/null +++ b/docs/rst-code/brails.rst @@ -0,0 +1,28 @@ +brails package +============== + +.. automodule:: brails + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.filters + brails.imputers + brails.processors + brails.scrapers + brails.types + brails.utils + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.exceptions diff --git a/docs/rst-code/brails.scrapers.aerial_image_harvester.html b/docs/rst-code/brails.scrapers.aerial_image_harvester.html new file mode 100644 index 0000000..10bd5f3 --- /dev/null +++ b/docs/rst-code/brails.scrapers.aerial_image_harvester.html @@ -0,0 +1,146 @@ + + + + + + + brails.scrapers.aerial_image_harvester module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.aerial_image_harvester module

+
+
+class brails.scrapers.aerial_image_harvester.ArialHarvester(name)
+

Bases: ABC

+
+
+abstract getImage(Address)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.boundary.boundary_location.html b/docs/rst-code/brails.scrapers.boundary.boundary_location.html new file mode 100644 index 0000000..dc511a9 --- /dev/null +++ b/docs/rst-code/brails.scrapers.boundary.boundary_location.html @@ -0,0 +1,138 @@ + + + + + + + + + brails.scrapers.boundary.boundary_location module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.boundary.boundary_location module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.boundary.boundary_location.rst b/docs/rst-code/brails.scrapers.boundary.boundary_location.rst new file mode 100644 index 0000000..36a866a --- /dev/null +++ b/docs/rst-code/brails.scrapers.boundary.boundary_location.rst @@ -0,0 +1,7 @@ +brails.scrapers.boundary.boundary\_location module +================================================== + +.. automodule:: brails.scrapers.boundary.boundary_location + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.boundary.html b/docs/rst-code/brails.scrapers.boundary.html new file mode 100644 index 0000000..6a98f83 --- /dev/null +++ b/docs/rst-code/brails.scrapers.boundary.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.boundary package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.boundary package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.boundary.rst b/docs/rst-code/brails.scrapers.boundary.rst new file mode 100644 index 0000000..7496b00 --- /dev/null +++ b/docs/rst-code/brails.scrapers.boundary.rst @@ -0,0 +1,15 @@ +brails.scrapers.boundary package +================================ + +.. automodule:: brails.scrapers.boundary + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.boundary.boundary_location diff --git a/docs/rst-code/brails.scrapers.footprint_scraper.html b/docs/rst-code/brails.scrapers.footprint_scraper.html new file mode 100644 index 0000000..1cddaae --- /dev/null +++ b/docs/rst-code/brails.scrapers.footprint_scraper.html @@ -0,0 +1,170 @@ + + + + + + + + + brails.scrapers.footprint_scraper module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.footprint_scraper module

+

This module defines abstract FootprintScraper class

+
+
+class brails.scrapers.footprint_scraper.FootprintScraper(name)
+

Bases: ABC

+

Abstract base class representing a class that optains footprints for a region.

+
+
+
Methods:

get_footprints(location): An abstract method to return the footprint given a location

+
+
+
+
+
+abstract get_footprints(region: RegionBoundary) AssetInventory
+

An abstract class that must be implemented by subclasses.

+

This method will be used by the caller to obtain the footprints for builings in an area.

+
+
Args:
+
region (Region):

The region of interest.

+
+
+
+
Returns:
+
BuildingInventory:

A building inventory for buildings in the region.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.footprint_scraper.rst b/docs/rst-code/brails.scrapers.footprint_scraper.rst new file mode 100644 index 0000000..94f13ca --- /dev/null +++ b/docs/rst-code/brails.scrapers.footprint_scraper.rst @@ -0,0 +1,7 @@ +brails.scrapers.footprint\_scraper module +========================================= + +.. automodule:: brails.scrapers.footprint_scraper + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.google_satellite.google_satellite.html b/docs/rst-code/brails.scrapers.google_satellite.google_satellite.html new file mode 100644 index 0000000..5c4a88c --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_satellite.google_satellite.html @@ -0,0 +1,184 @@ + + + + + + + + + brails.scrapers.google_satellite.google_satellite module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.google_satellite.google_satellite module

+

This module defines GoogleSatellite class downloading Google satellite imagery.

+
+
+class brails.scrapers.google_satellite.google_satellite.GoogleSatellite
+

Bases: ImageScraper

+

A class for downloading satellite imagery from Google tilemaps.

+

This class is a subclass to the ImageScraper and provides functionality +to obtain satellite images for assets defined in an AssetInventory. The +images are retrieved based on the coordinates of the assets and saved to a +specified directory.

+
+
Methods:
+
get_images(inventory: AssetInventory, save_directory: str) -> ImageSet:

Retrieves satellite images for the assets in the given inventory +and saves them to the specified save_directory.

+
+
+
+
+
+
+get_images(inventory: AssetInventory, save_directory: str) ImageSet
+

Get satellite images of buildings given footprints in AssetInventory.

+
+
Args:
+
+
inventory (AssetInventory): AssetInventory for which the images

will be retrieved.

+
+
+
+
+
save_directory (str): Path to the folder where the retrieved images

will be saved

+
+
+
+
Returns:

ImageSet: An ImageSet for the assets in the inventory.

+
+
Raises:
+
ValueError: If the provided inventory is not an instance of

AssetInventory.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.google_satellite.google_satellite.rst b/docs/rst-code/brails.scrapers.google_satellite.google_satellite.rst new file mode 100644 index 0000000..7f7f78b --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_satellite.google_satellite.rst @@ -0,0 +1,7 @@ +brails.scrapers.google\_satellite.google\_satellite module +========================================================== + +.. automodule:: brails.scrapers.google_satellite.google_satellite + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.google_satellite.html b/docs/rst-code/brails.scrapers.google_satellite.html new file mode 100644 index 0000000..d8e9006 --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_satellite.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.google_satellite package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.google_satellite package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.google_satellite.rst b/docs/rst-code/brails.scrapers.google_satellite.rst new file mode 100644 index 0000000..f9f5ddf --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_satellite.rst @@ -0,0 +1,15 @@ +brails.scrapers.google\_satellite package +========================================= + +.. automodule:: brails.scrapers.google_satellite + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.google_satellite.google_satellite diff --git a/docs/rst-code/brails.scrapers.google_streetview.google_streetview.html b/docs/rst-code/brails.scrapers.google_streetview.google_streetview.html new file mode 100644 index 0000000..e212f2e --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_streetview.google_streetview.html @@ -0,0 +1,190 @@ + + + + + + + + + brails.scrapers.google_streetview.google_streetview module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.google_streetview.google_streetview module

+

This module defines GoogleStreetview class downloading Google street imagery.

+
+
+class brails.scrapers.google_streetview.google_streetview.GoogleStreetview(input_data: dict)
+

Bases: ImageScraper

+

A class that downloads street-level imagery and depth maps for buildings.

+

This class interfaces with the Google Street View API to obtain +high-resolution street-level images and corresponding depth maps based on +specified building footprints. It supports saving interim images and +collecting various camera metadata.

+
+
Attributes:
+
api_key (str): API key for authenticating requests to the Google

Street View API.

+
+
+
+
Methods:
+
get_images(inventory: AssetInventory, save_directory: str) -> ImageSet:

Retrieves street-level imagery, depthmap, building location and +camera parameters for the assets in the given inventory and saves +them to the specified save_directory.

+
+
+
+
+
+
+get_images(inventory: AssetInventory, save_directory: str) ImageSet
+

Get street-level images of buildings from footprints in AssetInventory.

+
+
Args:
+
+
inventory (AssetInventory): AssetInventory for which the images

will be retrieved.

+
+
+
+
+
save_directory (str): Path to the folder where the retrieved images

will be saved

+
+
+
+
Returns:

ImageSet: An ImageSet for the assets in the inventory.

+
+
Raises:
+
ValueError: If the provided inventory is not an instance of

AssetInventory.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.google_streetview.google_streetview.rst b/docs/rst-code/brails.scrapers.google_streetview.google_streetview.rst new file mode 100644 index 0000000..a8c6147 --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_streetview.google_streetview.rst @@ -0,0 +1,7 @@ +brails.scrapers.google\_streetview.google\_streetview module +============================================================ + +.. automodule:: brails.scrapers.google_streetview.google_streetview + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.google_streetview.html b/docs/rst-code/brails.scrapers.google_streetview.html new file mode 100644 index 0000000..4a7800e --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_streetview.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.google_streetview package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.google_streetview package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.google_streetview.rst b/docs/rst-code/brails.scrapers.google_streetview.rst new file mode 100644 index 0000000..96ee044 --- /dev/null +++ b/docs/rst-code/brails.scrapers.google_streetview.rst @@ -0,0 +1,15 @@ +brails.scrapers.google\_streetview package +========================================== + +.. automodule:: brails.scrapers.google_streetview + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.google_streetview.google_streetview diff --git a/docs/rst-code/brails.scrapers.html b/docs/rst-code/brails.scrapers.html new file mode 100644 index 0000000..cd44a3c --- /dev/null +++ b/docs/rst-code/brails.scrapers.html @@ -0,0 +1,160 @@ + + + + + + + + + brails.scrapers package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.image_scraper.html b/docs/rst-code/brails.scrapers.image_scraper.html new file mode 100644 index 0000000..cbe555e --- /dev/null +++ b/docs/rst-code/brails.scrapers.image_scraper.html @@ -0,0 +1,176 @@ + + + + + + + + + brails.scrapers.image_scraper module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.image_scraper module

+

This module defines the abstract ImageScraper class.

+
+
+class brails.scrapers.image_scraper.ImageScraper
+

Bases: ABC

+

Abstract base class for obtaining images for an AssetInventory.

+
+
+
Method:
+
get_images(inventory): An abstract method to return an ImageSet given

an AssetInventory

+
+
+
+
+
+
+
+abstract get_images(inventory: AssetInventory, save_directory: str) ImageSet
+

Abstract class that must be implemented by subclasses.

+

This method will be used by the caller to obtain the images for assets +in an area.

+
+
Args:
+
inventory (AssetInventory): AssetInventory for which the images

will be retrieved.

+
+
save_directory (str): Path to the folder where the retrieved images

will be saved

+
+
+
+
Returns:
+
ImageSet: An ImageSet containing the images for the assets in the

inventory.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.image_scraper.rst b/docs/rst-code/brails.scrapers.image_scraper.rst new file mode 100644 index 0000000..c9c1609 --- /dev/null +++ b/docs/rst-code/brails.scrapers.image_scraper.rst @@ -0,0 +1,7 @@ +brails.scrapers.image\_scraper module +===================================== + +.. automodule:: brails.scrapers.image_scraper + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.ms_footprint_scraper.html b/docs/rst-code/brails.scrapers.ms_footprint_scraper.html new file mode 100644 index 0000000..655757d --- /dev/null +++ b/docs/rst-code/brails.scrapers.ms_footprint_scraper.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.ms_footprint_scraper package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.ms_footprint_scraper package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.ms_footprint_scraper.ms_footprint_handler.html b/docs/rst-code/brails.scrapers.ms_footprint_scraper.ms_footprint_handler.html new file mode 100644 index 0000000..c0cbe72 --- /dev/null +++ b/docs/rst-code/brails.scrapers.ms_footprint_scraper.ms_footprint_handler.html @@ -0,0 +1,163 @@ + + + + + + + + + brails.scrapers.ms_footprint_scraper.ms_footprint_handler module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.ms_footprint_scraper.ms_footprint_handler module

+
+
+class brails.scrapers.ms_footprint_scraper.ms_footprint_handler.MS_FootprintScraper(input: dict)
+

Bases: FootprintScraper

+

A class to generate the foorprint data utilizing Microsofts

+

Attributes:

+
+
Methods:

__init__: Constructor that just creates an empty footprint +get_inventory(id, coordinates): to get the inventory

+
+
+
+
+get_footprints(region: RegionBoundary) AssetInventory
+

This method will be used by the caller to obtain the footprints for builings in an area.

+
+
Args:

region (RegionBoundary): The region of interest.

+
+
Returns:

BuildingInventory: A building inventory for buildings in the region.

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.ms_footprint_scraper.ms_footprint_handler.rst b/docs/rst-code/brails.scrapers.ms_footprint_scraper.ms_footprint_handler.rst new file mode 100644 index 0000000..b3ab4ac --- /dev/null +++ b/docs/rst-code/brails.scrapers.ms_footprint_scraper.ms_footprint_handler.rst @@ -0,0 +1,7 @@ +brails.scrapers.ms\_footprint\_scraper.ms\_footprint\_handler module +==================================================================== + +.. automodule:: brails.scrapers.ms_footprint_scraper.ms_footprint_handler + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.ms_footprint_scraper.rst b/docs/rst-code/brails.scrapers.ms_footprint_scraper.rst new file mode 100644 index 0000000..f030c9f --- /dev/null +++ b/docs/rst-code/brails.scrapers.ms_footprint_scraper.rst @@ -0,0 +1,15 @@ +brails.scrapers.ms\_footprint\_scraper package +============================================== + +.. automodule:: brails.scrapers.ms_footprint_scraper + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.ms_footprint_scraper.ms_footprint_handler diff --git a/docs/rst-code/brails.scrapers.nsi_parser.html b/docs/rst-code/brails.scrapers.nsi_parser.html new file mode 100644 index 0000000..6cf8f14 --- /dev/null +++ b/docs/rst-code/brails.scrapers.nsi_parser.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.nsi_parser package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.nsi_parser package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.nsi_parser.nsi_parser.html b/docs/rst-code/brails.scrapers.nsi_parser.nsi_parser.html new file mode 100644 index 0000000..1a354ec --- /dev/null +++ b/docs/rst-code/brails.scrapers.nsi_parser.nsi_parser.html @@ -0,0 +1,257 @@ + + + + + + + + + brails.scrapers.nsi_parser.nsi_parser module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.nsi_parser.nsi_parser module

+

This module defines a class for scraping data from NSI.

+
+
+class brails.scrapers.nsi_parser.nsi_parser.NSI_Parser
+

Bases: object

+
+
+GetNSIData(footprints: list, lengthUnit: str = 'ft', outfile: str = '')
+

Match NSI buildings points to a set of footprints.

+

Method that reads NSI buildings points and matches the data to a set +of footprints and writes the data in a BRAILS-compatible format

+
+
Args:
+
footprints: List of footprint data defined as a list of lists of

coordinates in EPSG 4326, i.e., [[vert1],….[vertlast]]. +Vertices are defined in [longitude,latitude] fashion.

+
+
+

lengthUnit: The units for the data to be returned in, ‘m’ or ‘ft’

+
+
outfile: string containing the name of the output file

Currently, only GeoJSON format is supported

+
+
+
+
Output:
+
dict: Attribute dictionary for the footprints containing the

attributes: 1)latitude, 2)longitude, 3)building plan area, +4)number of floors, 5)year of construction, 6)replacement cost, +7)structure type, 8)occupancy class, 9)footprint polygon

+
+
+
+
+
+ +
+
+GetRawDataROI(roi, outfile: str) None
+

Get NSI data within an ROI/area of footprints and write to GeoJSON.

+

Method that reads NSI buildings data finds the points within a +bounding polygon or matches a set of footprints, then writes the +extracted data into a GeoJSON file.

+
+
Args:
+
roi: Either 1) a list of footprint data defined as a list of

lists of coordinates in EPSG 4326, i.e., [[vert1],…. +[vertlast]]. Vertices are defined in [longitude,latitude] +fashion, or 2) a shapely polygon or multipolygon for the +boundary polygon of the region of interest.

+

outfile: string containing the name of the output file +Currently, only GeoJSON format is supported

+
+
+
+
+
+ +
+
+get_filtered_data_given_inventory(inventory: AssetInventory, length_unit: str = 'ft', outfile: str = '')
+

Get NSI data corresponding to an AssetInventory.

+
+
Input: RegionBoundary
+

The region boundary

+
+
+
length unit

The units data to be returned in, ‘m’ or ‘ft’

+
+
outfile

Optional string

+
+
+
+
Output: dict

Attribute dictionary for the footprints containing the attributes: +1)latitude, 2)longitude, 3)building plan area, 4)number of +floors, 5)year of construction, 6)replacement cost, 7)structure +type, 8)occupancy class, 9)footprint polygon

+
+
+
+ +
+
+get_raw_data_given_boundary(region_boundary: RegionBoundary, length_unit: str = 'ft', outfile: str = '') AssetInventory
+

Method that gets nsi data given a region boundary

+
+
Input: RegionBoundary
+

The region boundary

+
+
+
length unit

The units data to be returned in, ‘m’ or ‘ft’

+
+
outfile

Optional string

+
+
+
+
Output: AssetInventory

an AssetInventory

+
+
+
+ +
+
+get_raw_data_given_inventory(inventory: AssetInventory, length_unit: str = 'ft', outfile: str = '') AssetInventory
+

Method that gets nsi data given a region boundary

+
+
Input: AssetInventory
+

The Asset inventory whose footprints we use to obtain NSI data

+
+
+
length unit

The units data to be returned in, ‘m’ or ‘ft’

+
+
outfile

Optional string

+
+
+
+
Output: AssetInventory

The inputed AssetInventory is updated and returned. returned for clarity of code

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.nsi_parser.nsi_parser.rst b/docs/rst-code/brails.scrapers.nsi_parser.nsi_parser.rst new file mode 100644 index 0000000..7620d07 --- /dev/null +++ b/docs/rst-code/brails.scrapers.nsi_parser.nsi_parser.rst @@ -0,0 +1,7 @@ +brails.scrapers.nsi\_parser.nsi\_parser module +============================================== + +.. automodule:: brails.scrapers.nsi_parser.nsi_parser + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.nsi_parser.rst b/docs/rst-code/brails.scrapers.nsi_parser.rst new file mode 100644 index 0000000..f4b7aec --- /dev/null +++ b/docs/rst-code/brails.scrapers.nsi_parser.rst @@ -0,0 +1,15 @@ +brails.scrapers.nsi\_parser package +=================================== + +.. automodule:: brails.scrapers.nsi_parser + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.nsi_parser.nsi_parser diff --git a/docs/rst-code/brails.scrapers.osm_footprint_scraper.html b/docs/rst-code/brails.scrapers.osm_footprint_scraper.html new file mode 100644 index 0000000..3223852 --- /dev/null +++ b/docs/rst-code/brails.scrapers.osm_footprint_scraper.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.osm_footprint_scraper package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.osm_footprint_scraper package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.html b/docs/rst-code/brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.html new file mode 100644 index 0000000..ea50c77 --- /dev/null +++ b/docs/rst-code/brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.html @@ -0,0 +1,163 @@ + + + + + + + + + brails.scrapers.osm_footprint_scraper.osm_footprint_scraper module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.osm_footprint_scraper.osm_footprint_scraper module

+
+
+class brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.OSM_FootprintScraper(input: dict)
+

Bases: FootprintScraper

+

A class to generate the foorprint data utilizing Open Street Maps API

+

Attributes:

+
+
Methods:

__init__: Constructor that just creates an empty footprint +get_inventory(id, coordinates): to get the inventory

+
+
+
+
+get_footprints(region: RegionBoundary) AssetInventory
+

This method will be used by the caller to obtain the footprints for builings in an area.

+
+
Args:

region (RegionBoundary): The region of interest.

+
+
Returns:

BuildingInventory: A building inventory for buildings in the region.

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.rst b/docs/rst-code/brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.rst new file mode 100644 index 0000000..0ac6f09 --- /dev/null +++ b/docs/rst-code/brails.scrapers.osm_footprint_scraper.osm_footprint_scraper.rst @@ -0,0 +1,7 @@ +brails.scrapers.osm\_footprint\_scraper.osm\_footprint\_scraper module +====================================================================== + +.. automodule:: brails.scrapers.osm_footprint_scraper.osm_footprint_scraper + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.osm_footprint_scraper.rst b/docs/rst-code/brails.scrapers.osm_footprint_scraper.rst new file mode 100644 index 0000000..b51a98c --- /dev/null +++ b/docs/rst-code/brails.scrapers.osm_footprint_scraper.rst @@ -0,0 +1,15 @@ +brails.scrapers.osm\_footprint\_scraper package +=============================================== + +.. automodule:: brails.scrapers.osm_footprint_scraper + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.osm_footprint_scraper.osm_footprint_scraper diff --git a/docs/rst-code/brails.scrapers.rst b/docs/rst-code/brails.scrapers.rst new file mode 100644 index 0000000..39bb62f --- /dev/null +++ b/docs/rst-code/brails.scrapers.rst @@ -0,0 +1,31 @@ +brails.scrapers package +======================= + +.. automodule:: brails.scrapers + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.boundary + brails.scrapers.google_satellite + brails.scrapers.google_streetview + brails.scrapers.ms_footprint_scraper + brails.scrapers.nsi_parser + brails.scrapers.osm_footprint_scraper + brails.scrapers.usa_footprint_scraper + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.footprint_scraper + brails.scrapers.image_scraper + brails.scrapers.user_footprints diff --git a/docs/rst-code/brails.scrapers.street_image_harvester.html b/docs/rst-code/brails.scrapers.street_image_harvester.html new file mode 100644 index 0000000..f3c0cee --- /dev/null +++ b/docs/rst-code/brails.scrapers.street_image_harvester.html @@ -0,0 +1,146 @@ + + + + + + + brails.scrapers.street_image_harvester module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.street_image_harvester module

+
+
+class brails.scrapers.street_image_harvester.StreetImageHarvester(name)
+

Bases: ABC

+
+
+abstract getImage(Address)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.usa_footprint_scraper.html b/docs/rst-code/brails.scrapers.usa_footprint_scraper.html new file mode 100644 index 0000000..5760a68 --- /dev/null +++ b/docs/rst-code/brails.scrapers.usa_footprint_scraper.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.scrapers.usa_footprint_scraper package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.usa_footprint_scraper package

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.usa_footprint_scraper.rst b/docs/rst-code/brails.scrapers.usa_footprint_scraper.rst new file mode 100644 index 0000000..06e9cdb --- /dev/null +++ b/docs/rst-code/brails.scrapers.usa_footprint_scraper.rst @@ -0,0 +1,15 @@ +brails.scrapers.usa\_footprint\_scraper package +=============================================== + +.. automodule:: brails.scrapers.usa_footprint_scraper + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.scrapers.usa_footprint_scraper.usa_footprint_scraper diff --git a/docs/rst-code/brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.html b/docs/rst-code/brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.html new file mode 100644 index 0000000..8bca273 --- /dev/null +++ b/docs/rst-code/brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.html @@ -0,0 +1,163 @@ + + + + + + + + + brails.scrapers.usa_footprint_scraper.usa_footprint_scraper module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.usa_footprint_scraper.usa_footprint_scraper module

+
+
+class brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.USA_FootprintScraper(input: dict)
+

Bases: FootprintScraper

+

A class to generate the foorprint data utilizing USA Structures

+

Attributes:

+
+
Methods:

__init__: Constructor that just creates an empty footprint +get_inventory(id, coordinates): to get the inventory

+
+
+
+
+get_footprints(region: RegionBoundary) AssetInventory
+

This method will be used by the caller to obtain the footprints for builings in an area.

+
+
Args:

region (RegionBoundary): The region of interest.

+
+
Returns:

BuildingInventory: A building inventory for buildings in the region.

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.rst b/docs/rst-code/brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.rst new file mode 100644 index 0000000..edf7fa5 --- /dev/null +++ b/docs/rst-code/brails.scrapers.usa_footprint_scraper.usa_footprint_scraper.rst @@ -0,0 +1,7 @@ +brails.scrapers.usa\_footprint\_scraper.usa\_footprint\_scraper module +====================================================================== + +.. automodule:: brails.scrapers.usa_footprint_scraper.usa_footprint_scraper + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.scrapers.user_footprints.html b/docs/rst-code/brails.scrapers.user_footprints.html new file mode 100644 index 0000000..ed123ab --- /dev/null +++ b/docs/rst-code/brails.scrapers.user_footprints.html @@ -0,0 +1,159 @@ + + + + + + + + + brails.scrapers.user_footprints module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.scrapers.user_footprints module

+
+
+class brails.scrapers.user_footprints.UserFootprint
+

Bases: object

+
+
+fetch_footprint_data(queryarea, fpSource='osm', attrmap=None, lengthUnit='ft', outputFile='footprints.geojson')
+

Function that loads footprint data from OpenStreetMap, Microsoft, USA +Structures, user-defined data

+
+
Input: Location entry defined as a string or a list of strings

containing the area name(s) or a tuple containing the longitude +and longitude pairs for the bounding box of the area of interest +or a GeoJSON file containing footprint (or point location) and +inventory data

+
+
Output: Footprint information parsed as a list of lists with each

coordinate described in longitude and latitude pairs

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.scrapers.user_footprints.rst b/docs/rst-code/brails.scrapers.user_footprints.rst new file mode 100644 index 0000000..3b9001b --- /dev/null +++ b/docs/rst-code/brails.scrapers.user_footprints.rst @@ -0,0 +1,7 @@ +brails.scrapers.user\_footprints module +======================================= + +.. automodule:: brails.scrapers.user_footprints + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.types.asset_inventory.html b/docs/rst-code/brails.types.asset_inventory.html new file mode 100644 index 0000000..567d42b --- /dev/null +++ b/docs/rst-code/brails.types.asset_inventory.html @@ -0,0 +1,475 @@ + + + + + + + + + brails.types.asset_inventory module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.types.asset_inventory module

+

This module defines classes associated with asset inventories.

+
+
+class brails.types.asset_inventory.Asset(asset_id: str | int, coordinates: list[list[float]], features: dict[str, Any] | None = None)
+

Bases: object

+

A data structure for an asset that holds it coordinates and features.

+
+
Attributes:

asset_id (str|int):: Unique identifier for the asset. +coordinates (list[List[float]]): A list of coordinate pairs

+
+

[[lon1, lat1], [lon2, lat2], …, [lonN, latN]].

+
+
+
features (dict[str, any]): A dictionary of features (attributes) for

the asset.

+
+
+
+
Methods:
+
add_features(additional_features: dict[str, any],

overwrite: bool = True): Update the existing features in the asset.

+
+
+

print_info(): Print the coordinates and features of the asset.

+
+
+
+
+add_features(additional_features: dict, overwrite: bool = True)
+

Update the existing features in the asset.

+
+
Args:
+
additional_features (dict[str, any]): New features to merge into

the asset’s features.

+
+
overwrite (bool, optional): Whether to overwrite existing features.

Defaults to True.

+
+
+
+
+
+ +
+
+print_info()
+

Print the coordinates and features of the asset.

+
+ +
+ +
+
+class brails.types.asset_inventory.AssetInventory
+

Bases: object

+

A class representing a Asset Inventory.

+
+
Attributes:
+

inventory (dict): The inventory stored in a dict accessed by asset_id

+
+
+
Methods:

print_info(): Print the asset inventory. +add_asset(asset_id, Asset): Add an asset to the inventory. +add_asset_coordinates(asset_id, coordinates): Add an asset to the

+
+

inventory with just a list of coordinates.

+
+
+
add_asset_features(asset_id, features): Append new features to the

asset.

+
+
+

remove_asset(asset_id): Remove an asset to the inventory. +get_asset_features(asset_id): Get coordinates of a particular assset. +get_asset_coordinates(asset_id): Get features of a particular assset. +get_asset_ids(): Return the asset ids as a list. +get_random_sample(size, seed): Get subset of the inventory. +get_coordinates(): Return a list of footprints. +get_geojson(): Return inventory as a geojson dict. +write_to_geojson(): Wtite inventory to file in GeoJSON format. Also return inventory as a geojson dict! +read_from_csv(file_path, keep_existing, str_type, id_column): Read

+
+

inventory dataset from a csv table

+
+
+
add_asset_features_from_csv(file_path, id_column): Add asset features

from a csv file.

+
+
+
+
+
+
+
+
+add_asset(asset_id: str | int, asset: Asset) bool
+

Add an Asset to the inventory.

+
+
Args:

asset_id (str|int): The unique identifier for the asset. +asset (Asset): The asset to be added.

+
+
Returns:

bool: True if the asset was added successfully, False otherwise.

+
+
+
+ +
+
+add_asset_coordinates(asset_id: str | int, coordinates: list[list[float]]) bool
+

Add an Asset to the inventory by adding its coordinate information.

+
+
Args:

asset_id (str|int): The unique identifier for the asset. +coordinates (list[list[float]]): A two-dimensional list

+
+

representing the geometry in [[lon1, lat1], [lon2, lat2], …, +[lonN, latN]] format.

+
+
+
Returns:

bool: True if the asset was added successfully, False otherwise.

+
+
+
+ +
+
+add_asset_features(asset_id: str | int, new_features: dict, overwrite=True) bool
+

Add new asset features to the Asset with the specified ID.

+
+
Args:

asset_id (str|int): The unique identifier for the asset. +new_features (dict): A dictionary of features to add to the asset. +overwrite (bool): Whether to overwrite existing features with the

+
+

same keys. Defaults to True.

+
+
+
Returns:
+
bool: True if features were successfully added, False if the asset

does not exist or the operation fails.

+
+
+
+
+
+ +
+
+add_asset_features_from_csv(file_path, id_column) bool
+

Read inventory data from a CSV file and add it to the inventory.

+
+
Args:
+
file_path (str):

The path to the CSV file

+
+
id_column (str):

The name of column that contains id values. If None, new indicies will be assigned

+
+
+
+
Returns:
+
bool:

True if assets were addded, False otherwise.

+
+
+
+
+
+ +
+
+get_asset_coordinates(asset_id: str | int) tuple[bool, list]
+

Get the coordinates of a particular asset.

+
+
Args:

asset_id (str | int): The unique identifier for the asset.

+
+
Returns:
+
tuple[bool, list]]: A tuple where the first element is a boolean

indicating whether the asset was found, and the second element +is a list of coordinate pairs in the format [[lon1, lat1], +[lon2, lat2], …, [lonN, latN]] if the asset is present. +Returns an empty list if the asset is not found.

+
+
+
+
+
+ +
+
+get_asset_features(asset_id: str | int) tuple[bool, dict]
+

Get features of a particular asset.

+
+
Args:

asset_id (str|int): The unique identifier for the asset.

+
+
Returns:
+
tuple[bool, Dict]: A tuple where the first element is a boolean

indicating whether the asset was found, and the second element +is a dictionary containing the asset’s features if the asset +is present. Returns an empty dictionary if the asset is not +found.

+
+
+
+
+
+ +
+
+get_asset_ids() list[str | int]
+

Retrieve the IDs of all assets in the inventory.

+
+
Returns:
+
list[str | int]: A list of asset IDs, which may be strings or

integers.

+
+
+
+
+
+ +
+
+get_coordinates() tuple[list[list[list[float, float]]], list[str | int]]
+

Get geometry (coordinates) and keys of all assets in the inventory.

+
+
Returns:
+
tuple[list[list[list[float, float]]], list[str | int]]: A tuple

containing: +- A list of coordinates for each asset, where each coordinate

+
+

is represented as a list of [longitude, latitude] pairs.

+
+
    +
  • A list of asset keys corresponding to each Asset.

  • +
+
+
+
+
+
+ +
+
+get_dataframe(n_possible_worlds=1, features_possible_worlds=[]) bool
+

Read inventory data from a CSV file and add it to the inventory.

+
+
Args:
+
n_possible_worlds (int):

Number of possible worlds

+
+
features_possible_worlds (list of str):

Indicate the features with multiple possible worlds

+
+
+
+
Returns:
+
bool:

True if assets were addded, False otherwise.

+
+
+
+
+
+ +
+
+get_geojson() dict
+

Generate a GeoJSON representation of the assets in the inventory.

+
+
Returns:
+
dict: A dictionary in GeoJSON format containing all assets, with

each asset represented as a feature. Each feature includes the +geometry (Point or Polygon) and associated properties.

+
+
+
+
+
+ +
+
+get_random_sample(nsamples: int, seed: int | float | str | bytes | bytearray | None = None)
+

Generate a smaller AssetInventory with a random selection of assets.

+
+
Args:
+
nsamples (int): The number of assets to include in the sampled

inventory.

+
+
seed (int | float | str | bytes | bytearray | None): The seed for

the random generator. If None, the seed is set to the sytem +default (i.e., the current system time).

+
+
+
+
Returns:
+
AssetInventory: A new AssetInventory instance containing a random

subset of assets.

+
+
+
+
+
+ +
+
+print_info()
+

Print the asset inventory.

+
+ +
+
+read_from_csv(file_path, keep_existing, str_type='building', id_column=None) bool
+

Read inventory data from a CSV file and add it to the inventory.

+
+
Args:
+
file_path (str):

The path to the CSV file

+
+
keep_existing (bool):

If False, the inventory will be initialized

+
+
str_type (str):

“building” or “bridge”

+
+
id_column (str):

The name of column that contains id values. If None, new indicies will be assigned

+
+
+
+
Returns:
+
bool:

True if assets were addded, False otherwise.

+
+
+
+
+
+ +
+
+remove_asset(asset_id: str | int) bool
+

Remove an Asset from the inventory.

+
+
Args:

asset_id (str|int): The unique identifier for the asset.

+
+
Returns:

bool: True if asset was removed, False otherwise.

+
+
+
+ +
+
+write_to_geojson(output_file: str = '') dict
+

Generate a GeoJSON representation of the assets in the inventory.

+
+
Returns:
+
dict: A dictionary in GeoJSON format containing all assets, with

each asset represented as a feature. Each feature includes the +geometry (Point or Polygon) and associated properties.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.types.asset_inventory.rst b/docs/rst-code/brails.types.asset_inventory.rst new file mode 100644 index 0000000..8ef177a --- /dev/null +++ b/docs/rst-code/brails.types.asset_inventory.rst @@ -0,0 +1,7 @@ +brails.types.asset\_inventory module +==================================== + +.. automodule:: brails.types.asset_inventory + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.types.html b/docs/rst-code/brails.types.html new file mode 100644 index 0000000..74540d3 --- /dev/null +++ b/docs/rst-code/brails.types.html @@ -0,0 +1,145 @@ + + + + + + + + + brails.types package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.types.image_set.html b/docs/rst-code/brails.types.image_set.html new file mode 100644 index 0000000..93a6c17 --- /dev/null +++ b/docs/rst-code/brails.types.image_set.html @@ -0,0 +1,276 @@ + + + + + + + + + brails.types.image_set module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.types.image_set module

+

This module contains classes for managing and manipulating image sets.

+
+
Classes:
    +
  • Image: A class to represent an individual image.

  • +
  • ImageSet: A class for handling collections of images.

  • +
+
+
+
+
+class brails.types.image_set.Image(filename: str, properties: dict | None = None)
+

Bases: object

+

A class to represent an image.

+
+
Attributes:

filename (str): filename of image +properties (dict): properties of image if known, i.e., camera

+
+

location, depth map

+
+
+
Methods:

set_image: Set the filename for an Image. +update_properties: Update image properties. +print_info: Print Image properties.

+
+
+
+
+print_info()
+

Print Image properties.

+
+ +
+
+set_image(filename: str)
+

Set the filename for an Image.

+
+
Args:

filename (str): New filename.

+
+
+
+ +
+
+update_properties(additional_properties: dict)
+

Update Image properties.

+

Args: +additional_properties (dict): additional properties to update the

+
+

current Image properties

+
+
+ +
+ +
+
+class brails.types.image_set.ImageSet
+

Bases: object

+

A class representing a set of images.

+
+
Attributes:
+
+
dir_path (str):

A path to image directory if images all in same location.

+
+
images (dict):

A dict of all images, key is the id for the image, value is an +Image

+
+
+
+
+
Methods:

set_directory: Set the directory path and load existing images. +add_image: Create and add a new image to the ImageSet. +get_image: Retrieve an image by its key. +print_info: Print details of the image set.

+
+
+
+
+
+
+add_image(key: str | int, filename: str, properties: dict | None = None)
+

Create and add a new image to the ImageSet.

+
+
Args:

key (str|int): The identifier for the image. +filename (str): The name of the file containing the image. +properties (dict): Image properties (default is an empty dict).

+
+
Returns:

bool: True if Image is added, False if Image already exists.

+
+
+
+ +
+
+get_image(key: str | int)
+

Get an image.

+
+
Args:

key (str|int): The identifier for the image.

+
+
Returns:
+
Image:

The image or None if no image with key

+
+
+
+
+
+ +
+
+print_info()
+

Print the image set.

+
+ +
+
+set_directory(path_to_dir: str, include_existing_images: bool = False, limited_to_extension_types=None)
+

Set the directory path.

+
+
Args:
+
path_to_dir (str):

The path to the directory.

+
+
include_existing_images(bool):

Boolean to indicate if all files in path_to_dir should be +added in self.images.

+
+
limited_to_extension_types (list):

if include_existing_images will only include files with +specific extensions in list, default is None, i.e. +include all files

+
+
+
+
Returns:
+
bool:

True if the directory exists and is valid, False otherwise.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.types.image_set.rst b/docs/rst-code/brails.types.image_set.rst new file mode 100644 index 0000000..0b8f27a --- /dev/null +++ b/docs/rst-code/brails.types.image_set.rst @@ -0,0 +1,7 @@ +brails.types.image\_set module +============================== + +.. automodule:: brails.types.image_set + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.types.region_boundary.html b/docs/rst-code/brails.types.region_boundary.html new file mode 100644 index 0000000..b84bbf3 --- /dev/null +++ b/docs/rst-code/brails.types.region_boundary.html @@ -0,0 +1,164 @@ + + + + + + + + + brails.types.region_boundary module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.types.region_boundary module

+

This module defines RegionBoundary class to store region boundary polygons.

+
+
+class brails.types.region_boundary.RegionBoundary(input: dict | None = None)
+

Bases: object

+

A class for obtaining the bounding polygon for a specified region.

+
+
Attributes:

input (dict): The input data for the region.

+
+
Methods:
+
__init__(input): Initializes the RegionBoundary instance and validates

input.

+
+
+

get_boundary(): Returns the boundary polygon of the region provided.

+
+
+
+
+get_boundary()
+

Return the current boundary.

+
+
Output: tuple

A tuple consisting of bpoly, query area and osmid

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.types.region_boundary.rst b/docs/rst-code/brails.types.region_boundary.rst new file mode 100644 index 0000000..de2814d --- /dev/null +++ b/docs/rst-code/brails.types.region_boundary.rst @@ -0,0 +1,7 @@ +brails.types.region\_boundary module +==================================== + +.. automodule:: brails.types.region_boundary + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.types.rst b/docs/rst-code/brails.types.rst new file mode 100644 index 0000000..9093406 --- /dev/null +++ b/docs/rst-code/brails.types.rst @@ -0,0 +1,17 @@ +brails.types package +==================== + +.. automodule:: brails.types + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.types.asset_inventory + brails.types.image_set + brails.types.region_boundary diff --git a/docs/rst-code/brails.utils.brails_importer.html b/docs/rst-code/brails.utils.brails_importer.html new file mode 100644 index 0000000..80b4c11 --- /dev/null +++ b/docs/rst-code/brails.utils.brails_importer.html @@ -0,0 +1,114 @@ + + + + + + + + + brails.utils.brails_importer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils.brails_importer module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.utils.geo_tools.html b/docs/rst-code/brails.utils.geo_tools.html new file mode 100644 index 0000000..2085904 --- /dev/null +++ b/docs/rst-code/brails.utils.geo_tools.html @@ -0,0 +1,289 @@ + + + + + + + + + brails.utils.geo_tools module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils.geo_tools module

+

This module defines a class for geospatial analysis and operations.

+
+
+class brails.utils.geo_tools.GeoTools
+

Bases: object

+

A collection of static methods for geospatial analysis and operations.

+

The GeoTools class provides various utility functions to perform common +geospatial tasks, including distance calculations, polygon meshing, +plotting, and GeoJSON file handling. The methods leverage Shapely +geometries to operate on points and polygons, making it suitable for +geographical data manipulation and visualization.

+
+
Methods:
    +
  • haversine_dist(p1: list, p2: list) -> float: +Calculate the Haversine distance between two geographical points.

  • +
  • +
    mesh_polygon(polygon: Polygon, rows: int, cols: int) ->

    list[Polygon]: Split a polygon into a grid of individual +rectangular polygons.

    +
    +
    +
  • +
  • +
    plot_polygon_cells(bpoly: Polygon | MultiPolygon,

    rectangles: list[Polygon], output_file: str = ‘’): Plot a polygon +and its rectangular mesh, optionally saving the plot.

    +
    +
    +
  • +
  • +
    write_polygon_to_geojson(poly: Polygon | MultiPolygon,

    output_file: str): Write a Shapely Polygon or MultiPolygon to a +GeoJSON file.

    +
    +
    +
  • +
  • +
    match_points_to_polygons(points: list, polygons: list) ->

    tuple[list, dict]: Match points to polygons and return the +correspondence data.

    +
    +
    +
  • +
+
+
+
+
+static haversine_dist(p1: list, p2: list) float
+

Calculate the Haversine distance between two points.

+

This function computes the shortest distance over the earth’s surface +between two points specified by their latitude and longitude.

+
+
Args:
+
p1 (list): The first point as a list containing two floating-point

values, where the first element is the latitude and the second +is the longitude of the point in degrees.

+
+
p2 (list): The second point as a list containing two floating-point

values, where the first element is the latitude and the second +is the longitude of the point in degrees.

+
+
+
+
Returns:

float: The Haversine distance between the two points in feet.

+
+
+
+ +
+
+static match_points_to_polygons(points: list, polygons: list) tuple[list, dict, list]
+

Match points to polygons and return the correspondence data.

+

This function finds Shapely points that fall within given polygons. +If multiple points exist within a polygon, it selects the point closest +to the polygon’s centroid.

+
+
Args:

points (list): A list of Shapely points. +polygons (list): A list of polygon coordinates defined in

+
+

EPSG 4326 (longitude, latitude).

+
+
+
Returns:
+
tuple[list, dict, list]:
    +
  • A list of matched Shapely Point geometries.

  • +
  • +
    A dictionary mapping each polygon (represented as a string)

    to the corresponding matched point.

    +
    +
    +
  • +
  • +
    A list of the indices of polygons matched to points, with

    each index listed in the same order as the list of points.

    +
    +
    +
  • +
+
+
+
+
+
+ +
+
+static mesh_polygon(polygon: Polygon, rows: int, cols: int) list[Polygon]
+

Split a Spolygon into a grid of individual rectangular polygons.

+

This function divides the area of the input polygon into a specified +number of rows and columns, creating a mesh of rectangular cells. +Each cell is checked for intersection with the input polygon, and +only the intersecting parts are returned.

+
+
Args:

polygon (Polygon): A Shapely polygon to be meshed. +rows (int): The number of rows to divide the polygon into. +cols (int): The number of columns to divide the polygon into.

+
+
Returns:
+
list[Polygon]: A list of Shapely polygons representing the

individual rectangular cells that mesh the input polygon.

+
+
+
+
+
+ +
+
+static plot_polygon_cells(bpoly: Polygon | MultiPolygon, rectangles: list[Polygon], output_file: str = '')
+

Plot a polygon and its rectangular mesh, optionally saving the plot.

+
+
Args:
+
bpoly (Polygon | MultiPolygon): A Shapely polygon or MultiPolygon

to plot.

+
+
rectangles (list[Polygon]): A list of Shapely polygons representing

the rectangular cells that mesh input polygon.

+
+
output_file (str, optional): Filename to save the plot as a PNG

image. If empty string, the plot is not saved.

+
+
+
+
Raises:

ValueError: If fout is provided and an invalid filename is given.

+
+
+
+ +
+
+static write_polygon_to_geojson(poly: Polygon | MultiPolygon, output_file: str)
+

Write a Shapely Polygon or MultiPolygon to a GeoJSON file.

+
+
Args:
+
poly (Polygon | MultiPolygon): A Shapely polygon or MultiPolygon to

be written.

+
+
+

output_file (str): The output filename for the GeoJSON file.

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.utils.geo_tools.rst b/docs/rst-code/brails.utils.geo_tools.rst new file mode 100644 index 0000000..19ca8e0 --- /dev/null +++ b/docs/rst-code/brails.utils.geo_tools.rst @@ -0,0 +1,7 @@ +brails.utils.geo\_tools module +============================== + +.. automodule:: brails.utils.geo_tools + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.utils.html b/docs/rst-code/brails.utils.html new file mode 100644 index 0000000..34c49c4 --- /dev/null +++ b/docs/rst-code/brails.utils.html @@ -0,0 +1,151 @@ + + + + + + + + + brails.utils package — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils package

+

utils module of the brails package.

+

Available classes: +- GeoTools: Class containing static methods geospatial analysis & operations. +- Importer: Class for importing class files. +- InputValidator: Class for validating BRAILS input data.

+
+

Submodules

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.utils.importer.html b/docs/rst-code/brails.utils.importer.html new file mode 100644 index 0000000..447df80 --- /dev/null +++ b/docs/rst-code/brails.utils.importer.html @@ -0,0 +1,198 @@ + + + + + + + + + brails.utils.importer module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils.importer module

+

Utility classes and methods for the brails module.

+
+
+class brails.utils.importer.Importer(package_name='brails')
+

Bases: object

+

Dynamically parses files of a specified package and access its classes.

+

This class parses a given package directory, identifies all +non-abstract classes, and makes them accessible through a dynamic +import mechanism. It ensures that class names are unique within +the package scope to avoid conflicts. Classes can be retrieved and +instantiated by their name using the get_class method.

+
+
Attributes:

package_path (Path): The file system path to the root of the package. +max_parse_levels (int): Limits parsing of class files to the first

+
+

max_parse_levels subdirectories.

+
+

classes (dict): A dictionary mapping class names to their module paths.

+
+
Raises:

NotFoundError: If the specified package or class cannot be found. +BrailsError: If duplicate class names are found in the code base.

+
+
+
+
+get_class(class_name: str) Any
+

Retrieve and import a class by its name.

+
+
Args:

class_name (str): The name of the class to retrieve.

+
+
Returns:

Any: The class object if found, otherwise raises BrailsError.

+
+
Raises:

NotFoundError: If the class cannot be found.

+
+
+
+ +
+
+get_object(json_object: dict[str, Any]) Any
+

Create an instance of a class from JSON object data.

+
+
Args:
+
json_object (dict[str, Any]): A dictionary containing “classType”

and “objData” keys.

+
+
+
+
Returns:
+
Any: An instance of the specified class, initialized with

objData.

+
+
+
+
Raises:
+
NotFoundError: If “classType” or “objData” is missing, or if the

class is not found.

+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.utils.importer.rst b/docs/rst-code/brails.utils.importer.rst new file mode 100644 index 0000000..e599135 --- /dev/null +++ b/docs/rst-code/brails.utils.importer.rst @@ -0,0 +1,7 @@ +brails.utils.importer module +============================ + +.. automodule:: brails.utils.importer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.utils.input_validator.html b/docs/rst-code/brails.utils.input_validator.html new file mode 100644 index 0000000..d1db1f9 --- /dev/null +++ b/docs/rst-code/brails.utils.input_validator.html @@ -0,0 +1,205 @@ + + + + + + + + + brails.utils.input_validator module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils.input_validator module

+

This module provides a utility class for validating input data in BRAILS.

+
+
+class brails.utils.input_validator.InputValidator
+

Bases: object

+

A utility class for validating BRAILS input data.

+

The InputValidator class provides static methods to ensure that the inputs +provided to brails are of the correct type and format. It includes methods +to validate coordinate lists, polygons, and other relevant data structures.

+
+
Methods:
    +
  • +
    is_float(element: Any) -> bool: Checks if the given input_value can

    be converted to a float.

    +
    +
    +
  • +
  • +
    validate_coordinates(coordinates: list[list[float]]

    ) -> tuple[bool, str]: Validates a two-dimensional list of +coordinates ensuring that each coordinate pair consists of two +floats within the valid range for longitude and latitude.

    +
    +
    +
  • +
+
+
+
+
+static is_float(input_value: Any) bool
+

Check if the given input_value can be converted to a float.

+
+
Args:

input_value (Any): The input_value to check.

+
+
Returns:
+
bool: True if the input_value can be converted to a float, False

otherwise.

+
+
+
+
+
+ +
+
+validate_coordinates() tuple[bool, str]
+

Validate input for coordinates.

+
+
Args:
+
coordinates (list[list[float]]): A two-dimensional list

representing the geometry in [[lon1, lat1], [lon2, lat2], …, +[lonN, latN]] format.

+
+
+
+
Returns:
+
tuple[bool, str]: A tuple containing:
    +
  • A boolean indicating if all coordinates are valid.

  • +
  • +
    A message string describing any issues found, or confirming

    validation success.

    +
    +
    +
  • +
+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.utils.input_validator.rst b/docs/rst-code/brails.utils.input_validator.rst new file mode 100644 index 0000000..b94a727 --- /dev/null +++ b/docs/rst-code/brails.utils.input_validator.rst @@ -0,0 +1,7 @@ +brails.utils.input\_validator module +==================================== + +.. automodule:: brails.utils.input_validator + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.utils.rst b/docs/rst-code/brails.utils.rst new file mode 100644 index 0000000..d0806bf --- /dev/null +++ b/docs/rst-code/brails.utils.rst @@ -0,0 +1,18 @@ +brails.utils package +==================== + +.. automodule:: brails.utils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + brails.utils.geo_tools + brails.utils.importer + brails.utils.input_validator + brails.utils.segmentation_utils diff --git a/docs/rst-code/brails.utils.segmentation_utils.html b/docs/rst-code/brails.utils.segmentation_utils.html new file mode 100644 index 0000000..7acecfd --- /dev/null +++ b/docs/rst-code/brails.utils.segmentation_utils.html @@ -0,0 +1,141 @@ + + + + + + + + + brails.utils.segmentation_utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils.segmentation_utils module

+
+
+brails.utils.segmentation_utils.create_overlaid_image(base_image, mask_image, output_dir)
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/brails.utils.segmentation_utils.rst b/docs/rst-code/brails.utils.segmentation_utils.rst new file mode 100644 index 0000000..a5215f6 --- /dev/null +++ b/docs/rst-code/brails.utils.segmentation_utils.rst @@ -0,0 +1,7 @@ +brails.utils.segmentation\_utils module +======================================= + +.. automodule:: brails.utils.segmentation_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/brails.utils.utils.html b/docs/rst-code/brails.utils.utils.html new file mode 100644 index 0000000..3cbe3ac --- /dev/null +++ b/docs/rst-code/brails.utils.utils.html @@ -0,0 +1,201 @@ + + + + + + + brails.utils.utils module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brails.utils.utils module

+

Utility classes and methods for the brails module.

+
+
+class brails.utils.utils.Importer(package_name='brails')
+

Bases: object

+

Dynamically parses the files of a specified package and provides +access to the defined classes.

+

This class parses a given package directory, identifies all +non-abstract classes, and makes them accessible through a dynamic +import mechanism. It ensures that class names are unique within +the package scope to avoid conflicts. Classes can be retrieved and +instantiated by their name using the get_class method.

+
+

Attributes

+
+
package_path (Path):

The file system path to the root of the package.

+
+
max_parse_levels (int):

An integer that limits parsing of class files to the fisrt max_parse)levels subdirectories

+
+
classes (dict):

A dictionary mapping class names to their module paths.

+
+
+
+
+

Raises

+
+
NotFoundError:

If the specified package or class cannot be found.

+
+
NotFoundError:

If the specified package or class cannot be found.

+
+
BrailsError:

If duplicate class names are found in the code base.

+
+
+
+
+get_class(class_name)
+

Retrieve and import a class by its name.

+
+

Parameters

+
+
class_name (str):

The name of the class to retrieve.

+
+
+
+
+

Returns

+
+

The class object if found, otherwise raises BrailsError.

+
+
+
+

Raises

+
+
NotFoundError:

If the class cannot be found.

+
+
+
+
+ +
+
+get_object(json_object)
+
+ +
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/conf.html b/docs/rst-code/conf.html new file mode 100644 index 0000000..5469ffb --- /dev/null +++ b/docs/rst-code/conf.html @@ -0,0 +1,114 @@ + + + + + + + + + conf module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

conf module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/conf.rst b/docs/rst-code/conf.rst new file mode 100644 index 0000000..18f10b8 --- /dev/null +++ b/docs/rst-code/conf.rst @@ -0,0 +1,7 @@ +conf module +=========== + +.. automodule:: conf + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/rst-code/modules.html b/docs/rst-code/modules.html new file mode 100644 index 0000000..15eeeea --- /dev/null +++ b/docs/rst-code/modules.html @@ -0,0 +1,123 @@ + + + + + + + + + brailsPlusPlus — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

brailsPlusPlus

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/modules.rst b/docs/rst-code/modules.rst new file mode 100644 index 0000000..63fb278 --- /dev/null +++ b/docs/rst-code/modules.rst @@ -0,0 +1,9 @@ +brailsPlusPlus +============== + +.. toctree:: + :maxdepth: 1 + + brails + conf + setup diff --git a/docs/rst-code/setup.html b/docs/rst-code/setup.html new file mode 100644 index 0000000..2307055 --- /dev/null +++ b/docs/rst-code/setup.html @@ -0,0 +1,114 @@ + + + + + + + + + setup module — BRAILS++ documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

setup module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/rst-code/setup.rst b/docs/rst-code/setup.rst new file mode 100644 index 0000000..552eb49 --- /dev/null +++ b/docs/rst-code/setup.rst @@ -0,0 +1,7 @@ +setup module +============ + +.. automodule:: setup + :members: + :undoc-members: + :show-inheritance: