gt4sd.cli.inference module

Run inference pipelines for the GT4SD.

Summary

Classes:

AlgorithmApplicationArguments

Algorithm application arguments.

InferenceArguments

Inference arguments.

Functions:

main

Run an inference pipeline.

Reference

class AlgorithmApplicationArguments(algorithm_type=None, domain=None, algorithm_name=None, algorithm_application=None, algorithm_version=None)[source]

Bases: object

Algorithm application arguments.

__name__ = 'AlgorithmApplicationArguments'
algorithm_type: Optional[str] = None
domain: Optional[str] = None
algorithm_name: Optional[str] = None
algorithm_application: Optional[str] = None
algorithm_version: Optional[str] = None
__annotations__ = {'algorithm_application': typing.Optional[str], 'algorithm_name': typing.Optional[str], 'algorithm_type': typing.Optional[str], 'algorithm_version': typing.Optional[str], 'domain': typing.Optional[str]}
__dataclass_fields__ = {'algorithm_application': Field(name='algorithm_application',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm application.'}),kw_only=False,_field_type=_FIELD), 'algorithm_name': Field(name='algorithm_name',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm name.'}),kw_only=False,_field_type=_FIELD), 'algorithm_type': Field(name='algorithm_type',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm type, supported types: conditional_generation, controlled_sampling, generation, prediction.'}),kw_only=False,_field_type=_FIELD), 'algorithm_version': Field(name='algorithm_version',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm version.'}),kw_only=False,_field_type=_FIELD), 'domain': Field(name='domain',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Domain of the inference algorithm, supported types: materials, nlp, vision.'}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__dict__ = mappingproxy({'__module__': 'gt4sd.cli.inference', '__annotations__': {'algorithm_type': typing.Optional[str], 'domain': typing.Optional[str], 'algorithm_name': typing.Optional[str], 'algorithm_application': typing.Optional[str], 'algorithm_version': typing.Optional[str]}, '__doc__': 'Algorithm application arguments.', '__name__': 'algorithm_base_args', 'algorithm_type': None, 'domain': None, 'algorithm_name': None, 'algorithm_application': None, 'algorithm_version': None, '__dict__': <attribute '__dict__' of 'AlgorithmApplicationArguments' objects>, '__weakref__': <attribute '__weakref__' of 'AlgorithmApplicationArguments' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False), '__dataclass_fields__': {'algorithm_type': Field(name='algorithm_type',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm type, supported types: conditional_generation, controlled_sampling, generation, prediction.'}),kw_only=False,_field_type=_FIELD), 'domain': Field(name='domain',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Domain of the inference algorithm, supported types: materials, nlp, vision.'}),kw_only=False,_field_type=_FIELD), 'algorithm_name': Field(name='algorithm_name',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm name.'}),kw_only=False,_field_type=_FIELD), 'algorithm_application': Field(name='algorithm_application',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm application.'}),kw_only=False,_field_type=_FIELD), 'algorithm_version': Field(name='algorithm_version',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm version.'}),kw_only=False,_field_type=_FIELD)}, '__init__': <function AlgorithmApplicationArguments.__init__>, '__repr__': <function AlgorithmApplicationArguments.__repr__>, '__eq__': <function AlgorithmApplicationArguments.__eq__>, '__hash__': None, '__match_args__': ('algorithm_type', 'domain', 'algorithm_name', 'algorithm_application', 'algorithm_version')})
__doc__ = 'Algorithm application arguments.'
__eq__(other)

Return self==value.

__hash__ = None
__init__(algorithm_type=None, domain=None, algorithm_name=None, algorithm_application=None, algorithm_version=None)
__match_args__ = ('algorithm_type', 'domain', 'algorithm_name', 'algorithm_application', 'algorithm_version')
__module__ = 'gt4sd.cli.inference'
__repr__()

Return repr(self).

__weakref__

list of weak references to the object (if defined)

class InferenceArguments(target=None, number_of_samples=5, configuration_file=None, print_info=False)[source]

Bases: object

Inference arguments.

__name__ = 'InferenceArguments'
target: Optional[str] = None
number_of_samples: int = 5
configuration_file: Optional[str] = None
print_info: bool = False
__annotations__ = {'configuration_file': typing.Optional[str], 'number_of_samples': <class 'int'>, 'print_info': <class 'bool'>, 'target': typing.Optional[str]}
__dataclass_fields__ = {'configuration_file': Field(name='configuration_file',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Configuration file for the inference pipeline in JSON format.'}),kw_only=False,_field_type=_FIELD), 'number_of_samples': Field(name='number_of_samples',type=<class 'int'>,default=5,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Number of generated samples, defaults to 5.'}),kw_only=False,_field_type=_FIELD), 'print_info': Field(name='print_info',type=<class 'bool'>,default=False,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Print info for the selected algorithm, preventing inference run. Defaults to False.'}),kw_only=False,_field_type=_FIELD), 'target': Field(name='target',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Optional target for generation represented as a string. Defaults to None, it can be also provided in the configuration_file as an object, but the commandline takes precendence.'}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__dict__ = mappingproxy({'__module__': 'gt4sd.cli.inference', '__annotations__': {'target': typing.Optional[str], 'number_of_samples': <class 'int'>, 'configuration_file': typing.Optional[str], 'print_info': <class 'bool'>}, '__doc__': 'Inference arguments.', '__name__': 'inference_base_args', 'target': None, 'number_of_samples': 5, 'configuration_file': None, 'print_info': False, '__dict__': <attribute '__dict__' of 'InferenceArguments' objects>, '__weakref__': <attribute '__weakref__' of 'InferenceArguments' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False), '__dataclass_fields__': {'target': Field(name='target',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Optional target for generation represented as a string. Defaults to None, it can be also provided in the configuration_file as an object, but the commandline takes precendence.'}),kw_only=False,_field_type=_FIELD), 'number_of_samples': Field(name='number_of_samples',type=<class 'int'>,default=5,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Number of generated samples, defaults to 5.'}),kw_only=False,_field_type=_FIELD), 'configuration_file': Field(name='configuration_file',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Configuration file for the inference pipeline in JSON format.'}),kw_only=False,_field_type=_FIELD), 'print_info': Field(name='print_info',type=<class 'bool'>,default=False,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Print info for the selected algorithm, preventing inference run. Defaults to False.'}),kw_only=False,_field_type=_FIELD)}, '__init__': <function InferenceArguments.__init__>, '__repr__': <function InferenceArguments.__repr__>, '__eq__': <function InferenceArguments.__eq__>, '__hash__': None, '__match_args__': ('target', 'number_of_samples', 'configuration_file', 'print_info')})
__doc__ = 'Inference arguments.'
__eq__(other)

Return self==value.

__hash__ = None
__init__(target=None, number_of_samples=5, configuration_file=None, print_info=False)
__match_args__ = ('target', 'number_of_samples', 'configuration_file', 'print_info')
__module__ = 'gt4sd.cli.inference'
__repr__()

Return repr(self).

__weakref__

list of weak references to the object (if defined)

main()[source]

Run an inference pipeline.

Return type

None