From 941bcb867d0218098763a87256fc710cfc83d782 Mon Sep 17 00:00:00 2001 From: Gao Enhao Date: Thu, 21 Dec 2023 19:00:06 +0800 Subject: [PATCH] [FIX] delete incorrect substitution --- abl/data/structures/base_data_element.py | 4 ++-- abl/data/structures/list_data.py | 6 +++--- examples/hwf/hwf.ipynb | 2 +- examples/zoo/zoo.ipynb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/abl/data/structures/base_data_element.py b/abl/data/structures/base_data_element.py index 8bff0ea..a5822cf 100644 --- a/abl/data/structures/base_data_element.py +++ b/abl/data/structures/base_data_element.py @@ -7,7 +7,7 @@ import torch # Modified from -# https://github.com/open-mmlab/mmengine/blob/main/mmengine/data.structures/base_data_element.py +# https://github.com/open-mmlab/mmengine/blob/main/mmengine/structures/base_data_element.py class BaseDataElement: """A base data interface that supports Tensor-like and dict-like operations. @@ -74,7 +74,7 @@ class BaseDataElement: Examples: >>> import torch - >>> from mmengine.data.structures import BaseDataElement + >>> from mmengine.structures import BaseDataElement >>> gt_instances = BaseDataElement() >>> bboxes = torch.rand((5, 4)) >>> scores = torch.rand((5,)) diff --git a/abl/data/structures/list_data.py b/abl/data/structures/list_data.py index 61bd208..25bb0fc 100644 --- a/abl/data/structures/list_data.py +++ b/abl/data/structures/list_data.py @@ -15,16 +15,16 @@ IndexType = Union[str, slice, int, list, LongTypeTensor, BoolTypeTensor, np.ndar # Modified from -# https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/data_data.structures/instance_data.py # noqa +# https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/data_structures/instance_data.py # noqa class ListData(BaseDataElement): """ Data structure for example-level data. Subclass of :class:`BaseDataElement`. All value in `data_fields` should have the same length. This design refer to - https://github.com/facebookresearch/detectron2/blob/master/detectron2/data.structures/instances.py + https://github.com/facebookresearch/detectron2/blob/master/detectron2/structures/instances.py - ListData supports `index` and `slice` for data field. The type of value in data field can be either `None` or `list` of base data data.structures such as `torch.Tensor`, `numpy.ndarray`, `list`, `str` and `tuple`. + ListData supports `index` and `slice` for data field. The type of value in data field can be either `None` or `list` of base data structures such as `torch.Tensor`, `numpy.ndarray`, `list`, `str` and `tuple`. Examples: >>> from abl.data.structures import ListData diff --git a/examples/hwf/hwf.ipynb b/examples/hwf/hwf.ipynb index 3434fec..65e7481 100644 --- a/examples/hwf/hwf.ipynb +++ b/examples/hwf/hwf.ipynb @@ -55,7 +55,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Both `train_data` and `test_data` have the same data.structures: tuples with three components: X (list where each element is a list of images), gt_pseudo_label (list where each element is a list of symbols, i.e., pseudo-labels) and Y (list where each element is the computed result). The length and data.structures of datasets are illustrated as follows.\n", + "Both `train_data` and `test_data` have the same structures: tuples with three components: X (list where each element is a list of images), gt_pseudo_label (list where each element is a list of symbols, i.e., pseudo-labels) and Y (list where each element is the computed result). The length and structures of datasets are illustrated as follows.\n", "\n", "Note: ``gt_pseudo_label`` is only used to evaluate the performance of the learning part but not to train the model." ] diff --git a/examples/zoo/zoo.ipynb b/examples/zoo/zoo.ipynb index cc9b43c..7a85644 100644 --- a/examples/zoo/zoo.ipynb +++ b/examples/zoo/zoo.ipynb @@ -56,7 +56,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`train_data` and `test_data` share identical data.structures: tuples with three components: X (list where each element is a list of two images), gt_pseudo_label (list where each element is a list of two digits, i.e., pseudo-labels) and Y (list where each element is the sum of the two digits). The length and data.structures of datasets are illustrated as follows.\n", + "`train_data` and `test_data` share identical structures: tuples with three components: X (list where each element is a list of two images), gt_pseudo_label (list where each element is a list of two digits, i.e., pseudo-labels) and Y (list where each element is the sum of the two digits). The length and structures of datasets are illustrated as follows.\n", "\n", "Note: ``gt_pseudo_label`` is only used to evaluate the performance of the learning part but not to train the model." ] @@ -356,7 +356,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.18" }, "orig_nbformat": 4, "vscode": {