fruit_project.config

Shared configuration for fruit detection models. This module provides a single source of truth for model configs, class labels, and related settings.

Attributes

Functions

get_model_config(→ Dict)

Load model configuration from YAML file.

get_do_normalize(→ bool)

Get whether a model requires image normalization.

get_hf_checkpoint(→ Optional[str])

Get the HuggingFace checkpoint ID for a model.

get_input_size(→ tuple)

Get the input size for a model.

load_class_names_from_yaml(→ List[str])

Load class names from data.yaml file.

Module Contents

fruit_project.config._THIS_DIR[source]
fruit_project.config._WORKSPACE_ROOT[source]
fruit_project.config.CONF_DIR[source]
fruit_project.config.MODEL_CONF_DIR[source]
fruit_project.config.DATA_YAML_PATH[source]
fruit_project.config.CHECKPOINT_DIR[source]
fruit_project.config.SUPPORTED_MODELS: Dict[str, str][source]
fruit_project.config.CLASS_NAMES: List[str] = ['Apple', 'Cherry', 'Figs', 'Olive', 'Pomegranate', 'Orange', 'Rockmelon', 'Strawberry',...[source]
fruit_project.config.NUM_CLASSES: int = 12[source]
fruit_project.config.ID2LABEL: Dict[int, str][source]
fruit_project.config.LABEL2ID: Dict[str, int][source]
fruit_project.config.COLORS: List[str] = ['#FF6B6B', '#C0392B', '#8E44AD', '#2ECC71', '#E74C3C', '#F39C12', '#F1C40F', '#E91E63',...[source]
fruit_project.config.get_model_config(model_name: str) Dict[source]

Load model configuration from YAML file.

Parameters:

model_name – Name of the model (e.g., ‘rtdetrv2_50’)

Returns:

Dictionary with model configuration

fruit_project.config.get_do_normalize(model_name: str) bool[source]

Get whether a model requires image normalization.

Parameters:

model_name – Name of the model

Returns:

True if model requires normalization

fruit_project.config.get_hf_checkpoint(model_name: str) str | None[source]

Get the HuggingFace checkpoint ID for a model.

Parameters:

model_name – Name of the model

Returns:

HuggingFace checkpoint string or None

fruit_project.config.get_input_size(model_name: str) tuple[source]

Get the input size for a model.

Parameters:

model_name – Name of the model

Returns:

Tuple of (height, width)

fruit_project.config.HF_FRUIT_MODELS: Dict[str, str][source]
fruit_project.config.load_class_names_from_yaml(yaml_path: pathlib.Path | None = None) List[str][source]

Load class names from data.yaml file.

Parameters:

yaml_path – Path to the yaml file (defaults to DATA_YAML_PATH)

Returns:

List of class names