Skip to content

Commit

Permalink
update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
paoxiaode committed Oct 12, 2023
1 parent 1d2be42 commit 19b9269
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions python/dgl/data/lrgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ def __getitem__(self, idx):
return Subset(self, idx.cpu())

raise ValueError(
"""
Not support tensor idx when transform is not None
"""
"Tensor idx not supported when transform is not None."
)

if self._transform is None:
Expand Down Expand Up @@ -533,9 +531,7 @@ def __getitem__(self, idx):
return Subset(self, idx.cpu())

raise ValueError(
"""
Not support tensor idx when transform is not None
"""
"Tensor idx not supported when transform is not None."
)

if self._transform is None:
Expand Down Expand Up @@ -577,14 +573,16 @@ class VOCSuperpixelsDataset(DGLDataset):
construct_format : str, optional
Option to select the graph construction format.
Should be chosen from the following formats:
"edge_wt_only_coord": the graphs are 8-nn graphs with the edge weights
computed based on only spatial coordinates of superpixel nodes.
"edge_wt_coord_feat": the graphs are 8-nn graphs with the edge weights
computed based on combination of spatial coordinates and feature
values of superpixel nodes.
"edge_wt_region_boundary": the graphs region boundary graphs where two
regions (i.e. superpixel nodes) have an edge between them if they share
a boundary in the original image.
- "edge_wt_only_coord": the graphs are 8-nn graphs with the edge weights
computed based on only spatial coordinates of superpixel nodes.
- "edge_wt_coord_feat": the graphs are 8-nn graphs with the edge weights
computed based on combination of spatial coordinates and feature
values of superpixel nodes.
- "edge_wt_region_boundary": the graphs region boundary graphs where two
regions (i.e. superpixel nodes) have an edge between them if they
share a boundary in the original image.
Default: "edge_wt_region_boundary".
slic_compactness : int, optional
Option to select compactness of slic that was used for superpixels
Expand Down Expand Up @@ -792,9 +790,7 @@ def __getitem__(self, idx):
return Subset(self, idx.cpu())

raise ValueError(
"""
Not support tensor idx when transform is not None
"""
"Tensor idx not supported when transform is not None."
)

if self._transform is None:
Expand All @@ -806,8 +802,8 @@ def __getitem__(self, idx):
class COCOSuperpixelsDataset(DGLDataset):
r"""COCO superpixel dataset for the node classification task.
DGL dataset of COCOSuperpixels which contains image superpixels
and a semantic segmentation label for each node superpixel.
DGL dataset of COCO-SP in the LRGB benckmark which contains image
superpixels and a semantic segmentation label for each node superpixel.
Based on the COCO 2017 dataset. Original source `<https://cocodataset.org>`_
Expand All @@ -833,6 +829,7 @@ class COCOSuperpixelsDataset(DGLDataset):
construct_format : str, optional
Option to select the graph construction format.
Should be chosen from the following formats:
- "edge_wt_only_coord": the graphs are 8-nn graphs with the edge weights
computed based on only spatial coordinates of superpixel nodes.
- "edge_wt_coord_feat": the graphs are 8-nn graphs with the edge weights
Expand All @@ -841,6 +838,7 @@ class COCOSuperpixelsDataset(DGLDataset):
- "edge_wt_region_boundary": the graphs region boundary graphs where two
regions (i.e. superpixel nodes) have an edge between them if they
share a boundary in the original image.
Default: "edge_wt_region_boundary".
slic_compactness : int, optional
Option to select compactness of slic that was used for superpixels
Expand Down Expand Up @@ -1075,9 +1073,7 @@ def __getitem__(self, idx):
if self._transform is None:
return Subset(self, idx.cpu())
raise ValueError(
"""
Tensor idx not supported when transform is not None.
"""
"Tensor idx not supported when transform is not None."
)

if self._transform is None:
Expand Down

0 comments on commit 19b9269

Please sign in to comment.