def get_config_from_weights(w_path, arch_params, name):
    """
    Extracts architecture parameters from the file name of the weights.
    Only works with standardized weights name.
    """
    
    w_path = os.path.basename(w_path)
    parts = w_path.split(name)[1]
    parts = parts.split('_')[0]
    parts = parts.split('-')
    new_param = {}
    for param in arch_params:
        param_part = [x for x in parts if param in x]
        param_value = int(param_part[0].split(param)[1])
        new_param[param] = param_value
    return new_param
Extracts architecture parameters from the file name of the weights.
Only works with standardized weights name.
ISR/utils/utils.py