def normalize_objects(objects):
    """
    Normalize the groups and owners from omero_marshal dicts.

    Take a list of dicts generated from omero_marshal and
    normalizes the groups and owners into separate
    lists. omero:details will only retain group and owner IDs.
    """
    experimenters = {}
    groups = {}
    objs = []
    for o in objects:
        exp = o['omero:details']['owner']
        experimenters[exp['@id']] = exp
        o['omero:details']['owner'] = {'@id': exp['@id']}
        grp = o['omero:details']['group']
        groups[grp['@id']] = grp
        o['omero:details']['group'] = {'@id': grp['@id']}
        objs.append(o)
    experimenters = list(experimenters.values())
    groups = list(groups.values())
    return objs, {'experimenters': experimenters, 'experimenterGroups': groups}
