High level techniques
PytorchImageModels(model_name, feature_layer=-1, flatten=True, device='cpu', apply_on_output=None, imgs_dirs='imgs_dirs', max_timeout=2, max_retries=5, max_workers=0, batch_size=64, resize_size=(227, 227))
Bases: HighLevelVisual
High level technique which uses the [timm library] (https://timm.fast.ai/) for feature extraction from images using pre-trained models
PARAMETER | DESCRIPTION |
---|---|
model_name |
a model name supported by the timm library
TYPE:
|
feature_layer |
the layer index from which the features will be retrieved NOTE: the model is loaded from the timm library with the parameter "features_only" set at True, meaning that only feature layers of the model will be available and accessible through the index
TYPE:
|
flatten |
whether the features obtained from the model should be flattened or not
TYPE:
|
imgs_dirs |
directory where the images are stored (or will be stored in the case of fields containing links)
TYPE:
|
max_timeout |
maximum time to wait before considering a request failed (image from link)
TYPE:
|
max_retries |
maximum number of retries to retrieve an image from a link
TYPE:
|
max_workers |
maximum number of workers for parallelism
TYPE:
|
batch_size |
batch size for the images dataloader
TYPE:
|
resize_size |
since the Tensorflow dataset requires all images to be of the same size, they will all be resized to the specified size. Note that if you were to specify a resize transformer in the preprocessing pipeline, the size specified in the latter will be the final resize size |
Source code in clayrs/content_analyzer/field_content_production_techniques/visual_techniques/high_level_techniques.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|