zensvi.cv.ClassifierQuality¶
- class zensvi.cv.ClassifierQuality(device=None, verbosity=1)¶
Bases:
zensvi.cv.classification.base.BaseClassifier
A classifier for identifying quality. The model is from Hou et al (2024) (https://github.com/ualsg/global-streetscapes).
- Parameters:
device (str, optional) – The device that the model should be loaded onto. Options are “cpu”, “cuda”, or “mps”. If None, the model tries to use a GPU if available; otherwise, falls back to CPU.
verbosity (int, optional) – Level of verbosity for progress bars. Defaults to 1. 0 = no progress bars, 1 = outer loops only, 2 = all loops.
- classify(dir_input: str | pathlib.Path, dir_summary_output: str | pathlib.Path, batch_size=1, save_format='json csv', verbosity: int = None) List[str] ¶
Classifies images based on quality.
- Parameters:
dir_input (Union[str, Path]) – Directory containing input images or path to a single image.
dir_summary_output (Union[str, Path]) – Directory to save summary output.
batch_size (int, optional) – Batch size for inference. Defaults to 1.
save_format (str, optional) – Space-separated string of formats to save results. Options are “json” and/or “csv”. Defaults to “json csv”.
verbosity (int, optional) – Level of verbosity for progress bars. If None, uses the instance’s verbosity level. 0 = no progress bars, 1 = outer loops only, 2 = all loops.
- Returns:
List of classification results.
- Return type:
List[str]
- property verbosity¶
Property for the verbosity level of progress bars.
- Returns:
verbosity level (0=no progress, 1=outer loops only, 2=all loops)
- Return type:
int