fiftyone.brain.internal.models#
- fiftyone.brain.internal.models.simple_resnet
simple_resnet()NetworkNetwork.nodes()Network.forward()Network.half()Network.T_destinationNetwork.add_module()Network.apply()Network.bfloat16()Network.buffers()Network.call_super_initNetwork.children()Network.compile()Network.cpu()Network.cuda()Network.double()Network.dump_patchesNetwork.eval()Network.extra_repr()Network.float()Network.get_buffer()Network.get_extra_state()Network.get_parameter()Network.get_submodule()Network.ipu()Network.load_state_dict()Network.modules()Network.mtia()Network.named_buffers()Network.named_children()Network.named_modules()Network.named_parameters()Network.parameters()Network.register_backward_hook()Network.register_buffer()Network.register_forward_hook()Network.register_forward_pre_hook()Network.register_full_backward_hook()Network.register_full_backward_pre_hook()Network.register_load_state_dict_post_hook()Network.register_load_state_dict_pre_hook()Network.register_module()Network.register_parameter()Network.register_state_dict_post_hook()Network.register_state_dict_pre_hook()Network.requires_grad_()Network.set_extra_state()Network.set_submodule()Network.share_memory()Network.state_dict()Network.to()Network.to_empty()Network.train()Network.type()Network.xpu()Network.zero_grad()Network.training
has_inputs()build_graph()pipeline()CropFlipLRCutoutPiecewiseLinearConstIdentityAddAddWeightedMulMul.T_destinationMul.add_module()Mul.apply()Mul.bfloat16()Mul.buffers()Mul.call_super_initMul.children()Mul.compile()Mul.cpu()Mul.cuda()Mul.double()Mul.dump_patchesMul.eval()Mul.extra_repr()Mul.float()Mul.forward()Mul.get_buffer()Mul.get_extra_state()Mul.get_parameter()Mul.get_submodule()Mul.half()Mul.ipu()Mul.load_state_dict()Mul.modules()Mul.mtia()Mul.named_buffers()Mul.named_children()Mul.named_modules()Mul.named_parameters()Mul.parameters()Mul.register_backward_hook()Mul.register_buffer()Mul.register_forward_hook()Mul.register_forward_pre_hook()Mul.register_full_backward_hook()Mul.register_full_backward_pre_hook()Mul.register_load_state_dict_post_hook()Mul.register_load_state_dict_pre_hook()Mul.register_module()Mul.register_parameter()Mul.register_state_dict_post_hook()Mul.register_state_dict_pre_hook()Mul.requires_grad_()Mul.set_extra_state()Mul.set_submodule()Mul.share_memory()Mul.state_dict()Mul.to()Mul.to_empty()Mul.train()Mul.type()Mul.xpu()Mul.zero_grad()Mul.training
FlattenFlatten.forward()Flatten.T_destinationFlatten.add_module()Flatten.apply()Flatten.bfloat16()Flatten.buffers()Flatten.call_super_initFlatten.children()Flatten.compile()Flatten.cpu()Flatten.cuda()Flatten.double()Flatten.dump_patchesFlatten.eval()Flatten.extra_repr()Flatten.float()Flatten.get_buffer()Flatten.get_extra_state()Flatten.get_parameter()Flatten.get_submodule()Flatten.half()Flatten.ipu()Flatten.load_state_dict()Flatten.modules()Flatten.mtia()Flatten.named_buffers()Flatten.named_children()Flatten.named_modules()Flatten.named_parameters()Flatten.parameters()Flatten.register_backward_hook()Flatten.register_buffer()Flatten.register_forward_hook()Flatten.register_forward_pre_hook()Flatten.register_full_backward_hook()Flatten.register_full_backward_pre_hook()Flatten.register_load_state_dict_post_hook()Flatten.register_load_state_dict_pre_hook()Flatten.register_module()Flatten.register_parameter()Flatten.register_state_dict_post_hook()Flatten.register_state_dict_pre_hook()Flatten.requires_grad_()Flatten.set_extra_state()Flatten.set_submodule()Flatten.share_memory()Flatten.state_dict()Flatten.to()Flatten.to_empty()Flatten.train()Flatten.type()Flatten.xpu()Flatten.zero_grad()Flatten.training
ConcatConcat.forward()Concat.T_destinationConcat.add_module()Concat.apply()Concat.bfloat16()Concat.buffers()Concat.call_super_initConcat.children()Concat.compile()Concat.cpu()Concat.cuda()Concat.double()Concat.dump_patchesConcat.eval()Concat.extra_repr()Concat.float()Concat.get_buffer()Concat.get_extra_state()Concat.get_parameter()Concat.get_submodule()Concat.half()Concat.ipu()Concat.load_state_dict()Concat.modules()Concat.mtia()Concat.named_buffers()Concat.named_children()Concat.named_modules()Concat.named_parameters()Concat.parameters()Concat.register_backward_hook()Concat.register_buffer()Concat.register_forward_hook()Concat.register_forward_pre_hook()Concat.register_full_backward_hook()Concat.register_full_backward_pre_hook()Concat.register_load_state_dict_post_hook()Concat.register_load_state_dict_pre_hook()Concat.register_module()Concat.register_parameter()Concat.register_state_dict_post_hook()Concat.register_state_dict_pre_hook()Concat.requires_grad_()Concat.set_extra_state()Concat.set_submodule()Concat.share_memory()Concat.state_dict()Concat.to()Concat.to_empty()Concat.train()Concat.type()Concat.xpu()Concat.zero_grad()Concat.training
BatchNormBatchNorm.T_destinationBatchNorm.add_module()BatchNorm.apply()BatchNorm.bfloat16()BatchNorm.buffers()BatchNorm.call_super_initBatchNorm.children()BatchNorm.compile()BatchNorm.cpu()BatchNorm.cuda()BatchNorm.double()BatchNorm.dump_patchesBatchNorm.eval()BatchNorm.extra_repr()BatchNorm.float()BatchNorm.forward()BatchNorm.get_buffer()BatchNorm.get_extra_state()BatchNorm.get_parameter()BatchNorm.get_submodule()BatchNorm.half()BatchNorm.ipu()BatchNorm.load_state_dict()BatchNorm.modules()BatchNorm.mtia()BatchNorm.named_buffers()BatchNorm.named_children()BatchNorm.named_modules()BatchNorm.named_parameters()BatchNorm.parameters()BatchNorm.register_backward_hook()BatchNorm.register_buffer()BatchNorm.register_forward_hook()BatchNorm.register_forward_pre_hook()BatchNorm.register_full_backward_hook()BatchNorm.register_full_backward_pre_hook()BatchNorm.register_load_state_dict_post_hook()BatchNorm.register_load_state_dict_pre_hook()BatchNorm.register_module()BatchNorm.register_parameter()BatchNorm.register_state_dict_post_hook()BatchNorm.register_state_dict_pre_hook()BatchNorm.requires_grad_()BatchNorm.reset_parameters()BatchNorm.reset_running_stats()BatchNorm.set_extra_state()BatchNorm.set_submodule()BatchNorm.share_memory()BatchNorm.state_dict()BatchNorm.to()BatchNorm.to_empty()BatchNorm.train()BatchNorm.type()BatchNorm.xpu()BatchNorm.zero_grad()BatchNorm.num_featuresBatchNorm.epsBatchNorm.momentumBatchNorm.affineBatchNorm.track_running_statsBatchNorm.running_meanBatchNorm.running_varBatchNorm.num_batches_trackedBatchNorm.training
conv_bn()residual()path_iter()
- fiftyone.brain.internal.models.torch
TorchImageModelConfigTorchImageModelConfig.attributes()TorchImageModelConfig.builder()TorchImageModelConfig.copy()TorchImageModelConfig.custom_attributes()TorchImageModelConfig.default()TorchImageModelConfig.download_model_if_necessary()TorchImageModelConfig.from_dict()TorchImageModelConfig.from_json()TorchImageModelConfig.from_kwargs()TorchImageModelConfig.from_str()TorchImageModelConfig.get_class_name()TorchImageModelConfig.init()TorchImageModelConfig.load_default()TorchImageModelConfig.parse_array()TorchImageModelConfig.parse_bool()TorchImageModelConfig.parse_categorical()TorchImageModelConfig.parse_dict()TorchImageModelConfig.parse_int()TorchImageModelConfig.parse_mutually_exclusive_fields()TorchImageModelConfig.parse_number()TorchImageModelConfig.parse_object()TorchImageModelConfig.parse_object_array()TorchImageModelConfig.parse_object_dict()TorchImageModelConfig.parse_path()TorchImageModelConfig.parse_raw()TorchImageModelConfig.parse_string()TorchImageModelConfig.serialize()TorchImageModelConfig.to_str()TorchImageModelConfig.validate_all_or_nothing_fields()TorchImageModelConfig.write_json()
TorchImageModelTorchImageModel.build_get_item()TorchImageModel.can_embed_promptsTorchImageModel.classesTorchImageModel.collate_fn()TorchImageModel.deviceTorchImageModel.embed()TorchImageModel.embed_all()TorchImageModel.from_config()TorchImageModel.from_dict()TorchImageModel.from_json()TorchImageModel.from_kwargs()TorchImageModel.get_embeddings()TorchImageModel.has_collate_fnTorchImageModel.has_embeddingsTorchImageModel.has_logitsTorchImageModel.mask_targetsTorchImageModel.media_typeTorchImageModel.num_classesTorchImageModel.parse()TorchImageModel.predict()TorchImageModel.predict_all()TorchImageModel.preprocessTorchImageModel.ragged_batchesTorchImageModel.required_keysTorchImageModel.skeletonTorchImageModel.store_logitsTorchImageModel.transformsTorchImageModel.using_gpuTorchImageModel.using_half_precisionTorchImageModel.validate()
Module contents#
Brain models.
Functions:
Returns the list of available models. |
|
Returns information about the models that have been downloaded. |
|
|
Determines whether the model of the given name is downloaded. |
|
Downloads the model of the given name. |
|
Installs any package requirements for the model with the given name. |
|
Ensures that the package requirements for the model with the given name are satisfied. |
|
Loads the model of the given name. |
|
Returns the path to the model on disk. |
|
Returns the |
|
Deletes the model from local disk, if necessary. |
Classes:
Mixin class for Config classes of |
- fiftyone.brain.internal.models.list_models()#
Returns the list of available models.
- Returns:
a list of model names
- fiftyone.brain.internal.models.list_downloaded_models()#
Returns information about the models that have been downloaded.
- Returns:
a dict mapping model names to (model path,
eta.core.models.Model) tuples
- fiftyone.brain.internal.models.is_model_downloaded(name)#
Determines whether the model of the given name is downloaded.
- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used- Returns:
True/False
- fiftyone.brain.internal.models.download_model(name, overwrite=False)#
Downloads the model of the given name.
If the model is already downloaded, it is not re-downloaded unless
overwrite == Trueis specified.- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used. Calllist_models()to see the available modelsoverwrite (False) – whether to overwrite any existing files
- Returns:
tuple of
model: the
eta.core.models.Modelinstance for the modelmodel_path: the path to the downloaded model on disk
- fiftyone.brain.internal.models.install_model_requirements(name, error_level=0)#
Installs any package requirements for the model with the given name.
- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used. Calllist_models()to see the available modelserror_level –
the error level to use, defined as:
0: raise error if a requirement install fails 1: log warning if a requirement install fails 2: ignore install fails
- fiftyone.brain.internal.models.ensure_model_requirements(name, error_level=0)#
Ensures that the package requirements for the model with the given name are satisfied.
- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used. Calllist_models()to see the available modelserror_level –
the error level to use, defined as:
0: raise error if a requirement is not satisfied 1: log warning if a requirement is not satisifed 2: ignore unsatisifed requirements
- fiftyone.brain.internal.models.load_model(name, download_if_necessary=True, install_requirements=False, error_level=0, **kwargs)#
Loads the model of the given name.
By default, the model will be downloaded if necessary.
- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used. Calllist_models()to see the available modelsdownload_if_necessary (True) – whether to download the model if it is not found in the specified directory
install_requirements – whether to install any requirements before loading the model. By default, this is False
error_level –
the error level to use, defined as:
0: raise error if a requirement is not satisfied 1: log warning if a requirement is not satisifed 2: ignore unsatisifed requirements
**kwargs – keyword arguments to inject into the model’s
Configinstance
- Returns:
- fiftyone.brain.internal.models.find_model(name)#
Returns the path to the model on disk.
The model must be downloaded. Use
download_model()to download models.- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used- Returns:
the path to the model on disk
- Raises:
ValueError – if the model does not exist or has not been downloaded
- fiftyone.brain.internal.models.get_model(name)#
Returns the
eta.core.models.Modelinstance for the model with the given name.- Parameters:
name – the name of the model
Returnsn
eta.core.models.ModelZooModel
- fiftyone.brain.internal.models.delete_model(name)#
Deletes the model from local disk, if necessary.
- Parameters:
name – the name of the model, which can have
@<ver>appended to refer to a specific version of the model. If no version is specified, the latest version of the model is used
- class fiftyone.brain.internal.models.HasBrainModel#
Bases:
HasPublishedModelMixin class for Config classes of
fiftyone.core.models.Modelinstances whose models are stored privately by the FiftyOne Brain.Methods:
Downloads the published model specified by the config, if necessary.
init(d)Initializes the published model config.
- download_model_if_necessary()#
Downloads the published model specified by the config, if necessary.
After this method is called, the model_path attribute will always contain the path to the model on disk.
- init(d)#
Initializes the published model config.
This method should be called by ModelConfig.__init__(), and it performs the following tasks:
Parses the model_name and model_path parameters
Populates any default parameters in the provided ModelConfig dict
- Parameters:
d – a ModelConfig dict
- Returns:
a ModelConfig dict with any default parameters populated