def to_dict(self, include_frames=False, include_private=False):
        """Serializes the sample view to a JSON dictionary.

        Args:
            include_frames (False): whether to include the frame labels for
                video samples
            include_private (False): whether to include private fields

        Returns:
            a JSON dict
        """
        d = super().to_dict(
            include_frames=include_frames, include_private=include_private
        )

        if self.selected_field_names or self.excluded_field_names:
            field_names = set(
                self._get_field_names(
                    include_private=include_private,
                    use_db_fields=True,
                )
            )

            if include_frames and self.media_type == fomm.VIDEO:
                field_names.add("frames")

            d = {k: v for k, v in d.items() if k in field_names}

        return d
Serializes the sample view to a JSON dictionary.

        Args:
            include_frames (False): whether to include the frame labels for
                video samples
            include_private (False): whether to include private fields

        Returns:
            a JSON dict
        
fiftyone/core/sample.py