def make_tf_example(self, image_or_path, classification, filename=None):
        """Makes a ``tf.train.Example`` for the given data.

        Args:
            image_or_path: an image or the path to the image on disk
            classification: a :class:`fiftyone.core.labels.Classification`
                instance, or ``None``
            filename (None): a filename for the image. Required when
                ``image_or_path`` is an image, in which case the extension of
                this filename determines the encoding used. If
                ``image_or_path`` is the path to an image, this is optional; by
                default, the basename of ``image_path`` is used

        Returns:
            a ``tf.train.Example``
        """
        img_bytes, img_shape, filename = self._parse_image_or_path(
            image_or_path, filename=filename
        )
        format = os.path.splitext(filename)[1][1:]  # no leading `.`

        feature = {
            "height": _int64_feature(img_shape[0]),
            "width": _int64_feature(img_shape[1]),
            "depth": _int64_feature(img_shape[2]),
            "filename": _bytes_feature(filename.encode()),
            "format": _bytes_feature(format.encode()),
            "image_bytes": _bytes_feature(img_bytes),
        }

        if classification is not None:
            label = classification.label
            feature["label"] = _bytes_feature(label.encode())

        return tf.train.Example(features=tf.train.Features(feature=feature))
Makes a ``tf.train.Example`` for the given data.

        Args:
            image_or_path: an image or the path to the image on disk
            classification: a :class:`fiftyone.core.labels.Classification`
                instance, or ``None``
            filename (None): a filename for the image. Required when
                ``image_or_path`` is an image, in which case the extension of
                this filename determines the encoding used. If
                ``image_or_path`` is the path to an image, this is optional; by
                default, the basename of ``image_path`` is used

        Returns:
            a ``tf.train.Example``
        
fiftyone/utils/tf.py