ducho.internal.father_classes package
Submodules
ducho.internal.father_classes.FeatureExtractorFather module
- class ducho.internal.father_classes.FeatureExtractorFather.FeatureExtractorFather(gpu='-1')[source]
Bases:
objectRepresents a feature extractor object.
This class provides functionality for feature extraction using various backend libraries and models.
- _backend_libraries_list
A list of backend libraries (e.g. tensorflow, pytorch, etc.).
- _model
The model for feature extraction.
- _output_layer
The output layer for feature extraction.
- _model_name
The name of the model.
- _gpu
The GPU index or ‘-1’ for CPU.
- Type:
str
- _device
The device for computation (GPU, MPS, CPU).
ducho.internal.father_classes.DatasetFather module
- class ducho.internal.father_classes.DatasetFather.DatasetFather(input_directory_path, output_directory_path, model_name)[source]
Bases:
objectRepresents a dataset handler object.
This class provides functionality to manage dataset directories and filenames for data extraction.
- _backend_libraries_list
A list of backend libraries (e.g. Tensorflow, Pytorch, Transformers)
- _model_name
The name of the model.
- Type:
str
- _input_directory_path
The path to the input directory or a dictionary containing data paths.
- Type:
str or dict
- _output_directory_path
The path to the output directory, where the extraction will be saved.
- Type:
str
- create_output_file(index, extracted_data, model_layer, fusion=None)[source]
Create an output numpy file with extracted data. (E.g. datasetFolder/framework/modelName/modelLayer/fileName.npy)
- Parameters:
index (int) – The index to the filenames list.
extracted_data (Any) – The data to be stored in the .npy file.
model_layer (str) – The name of the layer.
fusion (str, optional) – The type of fusion for multimodal models.
- Returns:
None