pliers.extractors.TFHubImageExtractor

class pliers.extractors.TFHubImageExtractor(url_or_path, features=None, input_dtype=None, keras_kwargs=None)[source]

Bases: TFHubExtractor

TFHub Extractor class for image models :param url_or_path: url or path to TFHub model :type url_or_path: str :param features: list of labels (for classification)

or other feature names. If not specified, returns numbered features (feature_0, feature_1, … ,feature_n)

Parameters

keras_kwargs (dict) – arguments to hub.KerasLayer call

__init__(url_or_path, features=None, input_dtype=None, keras_kwargs=None)[source]
transform(stim, *args, **kwargs)

Executes the transformation on the passed stim(s).

Parameters
  • stims (str, Stim, list) –

    One or more stimuli to process. Must be one of:

    • A string giving the path to a file that can be read in as a Stim (e.g., a .txt file, .jpg image, etc.)

    • A Stim instance of any type.

    • An iterable of stims, where each element is either a string or a Stim.

  • validation (str) –

    String specifying how validation errors should be handled. Must be one of:

    • ’strict’: Raise an exception on any validation error

    • ’warn’: Issue a warning for all validation errors

    • ’loose’: Silently ignore all validation errors

  • args – Optional positional arguments to pass onto the internal _transform call.

  • kwargs – Optional positional arguments to pass onto the internal _transform call.