Skip to content

common

[source]

model

icevision.models.ross.efficientdet.model.model(backbone, num_classes, img_size, **kwargs)

Creates the efficientdet model specified by model_name.

The model implementation is by Ross Wightman, original repo here.

Arguments

  • backbone icevision.models.ross.efficientdet.utils.EfficientDetBackboneConfig: Specifies the backbone to use create the model. For pretrained models, check this table.
  • num_classes int: Number of classes of your dataset (including background).
  • img_size int: Image size that will be fed to the model. Must be squared and divisible by 128.

Returns

A PyTorch model.


[source]

train_dl

icevision.models.ross.efficientdet.dataloaders.train_dl(dataset, batch_tfms=None, **dataloader_kwargs)

A DataLoader with a custom collate_fn that batches items as required for training the model.

Arguments

  • dataset: Possibly a Dataset object, but more generally, any Sequence that returns records.
  • batch_tfms: Transforms to be applied at the batch level.
  • **dataloader_kwargs: Keyword arguments that will be internally passed to a Pytorch DataLoader. The parameter collate_fn is already defined internally and cannot be passed here.

Returns

A Pytorch DataLoader.


[source]

valid_dl

icevision.models.ross.efficientdet.dataloaders.valid_dl(dataset, batch_tfms=None, **dataloader_kwargs)

A DataLoader with a custom collate_fn that batches items as required for validating the model.

Arguments

  • dataset: Possibly a Dataset object, but more generally, any Sequence that returns records.
  • batch_tfms: Transforms to be applied at the batch level.
  • **dataloader_kwargs: Keyword arguments that will be internally passed to a Pytorch DataLoader. The parameter collate_fn is already defined internally and cannot be passed here.

Returns

A Pytorch DataLoader.


[source]

infer_dl

icevision.models.ross.efficientdet.dataloaders.infer_dl(dataset, batch_tfms=None, **dataloader_kwargs)

A DataLoader with a custom collate_fn that batches items as required for inferring the model.

Arguments

  • dataset: Possibly a Dataset object, but more generally, any Sequence that returns records.
  • batch_tfms: Transforms to be applied at the batch level.
  • **dataloader_kwargs: Keyword arguments that will be internally passed to a Pytorch DataLoader. The parameter collate_fn is already defined internally and cannot be passed here.

Returns

A Pytorch DataLoader.


[source]

build_train_batch

icevision.models.ross.efficientdet.dataloaders.build_train_batch(records)

Builds a batch in the format required by the model when training.

Arguments

  • records: A Sequence of records.

Returns

A tuple with two items. The first will be a tuple like (images, targets), in the input format required by the model. The second will be a list of the input records.

Examples

Use the result of this function to feed the model.

batch, records = build_train_batch(records)
outs = model(*batch)


[source]

build_valid_batch

icevision.models.ross.efficientdet.dataloaders.build_valid_batch(records)

Builds a batch in the format required by the model when validating.

Arguments

  • records: A Sequence of records.

Returns

A tuple with two items. The first will be a tuple like (images, targets), in the input format required by the model. The second will be a list of the input records.

Examples

Use the result of this function to feed the model.

batch, records = build_valid_batch(records)
outs = model(*batch)


[source]

build_infer_batch

icevision.models.ross.efficientdet.dataloaders.build_infer_batch(records)

Builds a batch in the format required by the model when doing inference.

Arguments

  • records: A Sequence of records.

Returns

A tuple with two items. The first will be a tuple like (images, targets), in the input format required by the model. The second will be a list of the input records.

Use the result of this function to feed the model.

batch, records = build_infer_batch(records)
outs = model(*batch)