def deserialize_value(value):
    """Deserializes the given value.

    Args:
        value: the serialized value

    Returns:
        the value
    """
    if isinstance(value, dict):
        if "_cls" in value:
            # Serialized document
            _cls = _document_registry[value["_cls"]]
            return _cls.from_dict(value)

        if "$binary" in value:
            # Serialized array in extended format
            binary = json_util.loads(json.dumps(value))
            return fou.deserialize_numpy_array(binary)

        if "$oid" in value:
            return ObjectId(value["$oid"])

        return value

    if isinstance(value, bytes):
        # Serialized array in non-extended format
        return fou.deserialize_numpy_array(value)

    if isinstance(value, list):
        return [deserialize_value(v) for v in value]

    return value
Deserializes the given value.

    Args:
        value: the serialized value

    Returns:
        the value
    
fiftyone/core/odm/utils.py