inet.models package

Submodules

inet.models.data_structures module

class BoundingBox(x: float, y: float, w: float, h: float)[source]

Bases: object

BoundingBox representation to parse, draw and evaluate

A_I(other: inet.models.data_structures.BoundingBox) float[source]

Area of intersection with another BBox other :param other: a different BBox :return: the area of intersection

A_U(other: inet.models.data_structures.BoundingBox) float[source]

Area of union with other BBox other :param other: a different BBox :return: the area of union

GIoU(other: inet.models.data_structures.BoundingBox) float[source]

Generalized intersection over union (GIoU) based on [the paper](https://giou.stanford.edu/GIoU.pdf) :param other: other BB to compute GIoU with :return: GIoU for self and other

IoU(other: inet.models.data_structures.BoundingBox) float[source]

Computes the intersection over union (IoU) with a different BBox other :param other: a different BBox :return: intersection over union value

property area: float
Returns

draw(gc, color: str = 'red') None[source]

Method to render BBox into a graphic-context gc :param gc: graphics-context, e.g. matplotlib.pyplot.gca() :param color: the color of the BBox :return:

property half_h: float
Returns

half of the bbs height

property half_w: float
Returns

half of the bbs width

overlap(bb2: inet.models.data_structures.BoundingBox) Optional[inet.models.data_structures.BoundingBox][source]

Generates an overlapping BBox/convex hull around self and bb2 :param bb2: a different BBox :return: when overlapping, a new BBox containing both BBoxes

property x_max: float
Returns

x-max coordinate

property y_max: float
Returns

y-max coordinate

class ModelArchitecture(backbone: tensorflow.python.keras.engine.sequential.Sequential, name: str, create_model: Optional[Callable[[tensorflow.python.keras.engine.sequential.Sequential, Optional[str], Optional[int], Optional[float]], inet.models.architectures.base_model.TaskModel]] = None)[source]

Bases: object

Helper dataclass to simplify creation of model architecture, mostly used in development notebooks.

backbone: tensorflow.python.keras.engine.sequential.Sequential
create_model: Optional[Callable[[tensorflow.python.keras.engine.sequential.Sequential, Optional[str], Optional[int], Optional[float]], inet.models.architectures.base_model.TaskModel]] = None
name: str

inet.models.hyper_parameter_optimization module

class FrozenBlockConf(value)[source]

Bases: enum.Enum

Helper to freeze layers in a sequential model

TRAIN_ALL = 0
TRAIN_HALF = 1
TRAIN_NONE = 2
static choices()[source]

Helper to get list of available choices

process(backbone) None[source]

Method to propagate selection through a model instance :param backbone: the model to configure :return:

plot_hpo_values(trial) None[source]

Helper to display course of HP values during a HPO

read_trials(dir_name: str) List[source]

Reads trial files provided by [keras-tuner](https://keras.io/keras_tuner/).