pyg-nightly 2.7.0.dev20250521__py3-none-any.whl → 2.7.0.dev20250523__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyg_nightly-2.7.0.dev20250521.dist-info → pyg_nightly-2.7.0.dev20250523.dist-info}/METADATA +1 -1
- {pyg_nightly-2.7.0.dev20250521.dist-info → pyg_nightly-2.7.0.dev20250523.dist-info}/RECORD +7 -6
- torch_geometric/__init__.py +1 -1
- torch_geometric/datasets/__init__.py +2 -0
- torch_geometric/datasets/medshapenet.py +144 -0
- {pyg_nightly-2.7.0.dev20250521.dist-info → pyg_nightly-2.7.0.dev20250523.dist-info}/WHEEL +0 -0
- {pyg_nightly-2.7.0.dev20250521.dist-info → pyg_nightly-2.7.0.dev20250523.dist-info}/licenses/LICENSE +0 -0
{pyg_nightly-2.7.0.dev20250521.dist-info → pyg_nightly-2.7.0.dev20250523.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyg-nightly
|
3
|
-
Version: 2.7.0.
|
3
|
+
Version: 2.7.0.dev20250523
|
4
4
|
Summary: Graph Neural Network Library for PyTorch
|
5
5
|
Keywords: deep-learning,pytorch,geometric-deep-learning,graph-neural-networks,graph-convolutional-networks
|
6
6
|
Author-email: Matthias Fey <matthias@pyg.org>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
torch_geometric/__init__.py,sha256=
|
1
|
+
torch_geometric/__init__.py,sha256=NXgdZz24rbtahQqr0QfFVgXBwIpbaGoTZSu_4JTmXd8,2255
|
2
2
|
torch_geometric/_compile.py,sha256=f-WQeH4VLi5Hn9lrgztFUCSrN_FImjhQa6BxFzcYC38,1338
|
3
3
|
torch_geometric/_onnx.py,sha256=V9ffrIKSqhDw6xUZ12lkuSfNs48cQp2EeJ6Z19GfnVw,349
|
4
4
|
torch_geometric/backend.py,sha256=lVaf7aLoVaB3M-UcByUJ1G4T4FOK6LXAg0CF4W3E8jo,1575
|
@@ -55,7 +55,7 @@ torch_geometric/data/temporal.py,sha256=WOJ6gFrTLikaLhUvotyUF5ql14FkE5Ox3hNkdSp6
|
|
55
55
|
torch_geometric/data/view.py,sha256=XjkVSc-UWZFCT4DlXLShZtO8duhFQkS9gq88zZXANsk,1089
|
56
56
|
torch_geometric/data/lightning/__init__.py,sha256=w3En1tJfy3kSqe1MycpOyZpHFO3fxBCgNCUOznPA3YU,178
|
57
57
|
torch_geometric/data/lightning/datamodule.py,sha256=Bn9iaIfE4NWDDWWMqCvBeZ4bIW1Silx_Ol5CPJCliaQ,29242
|
58
|
-
torch_geometric/datasets/__init__.py,sha256=
|
58
|
+
torch_geometric/datasets/__init__.py,sha256=vIraHnDqD40Num-XwwNivjHQDboK9tmMvlZHjTAuljM,6291
|
59
59
|
torch_geometric/datasets/actor.py,sha256=oUxgJIX8bi5hJr1etWNYIFyVQNDDXi1nyVpHGGMEAGQ,4304
|
60
60
|
torch_geometric/datasets/airfrans.py,sha256=212gYsk7PvF-qcmvM2YXaOBhFrS79evAGg_sPHXih4w,5439
|
61
61
|
torch_geometric/datasets/airports.py,sha256=b3gkv3gY2JkUpmGiz36Z-g7EcnSfU8lBG1YsCOWdJ6k,3758
|
@@ -115,6 +115,7 @@ torch_geometric/datasets/linkx_dataset.py,sha256=_DsF5d2-o79-WibEKojIJKCpCF3VVxS
|
|
115
115
|
torch_geometric/datasets/lrgb.py,sha256=lOlzYCn9XbwQb3HK_wdufqjqK_aZbnoUqZu0NXZ6Oyw,11657
|
116
116
|
torch_geometric/datasets/malnet_tiny.py,sha256=E_ymC7_XS8rgZelcdevZyCDVjX5Ov21G6vwrG0JgAP0,5271
|
117
117
|
torch_geometric/datasets/md17.py,sha256=Wv-Q75uUDrFjRur5nOvg2TSw68UxkdYDJvkf3YA-T70,16735
|
118
|
+
torch_geometric/datasets/medshapenet.py,sha256=eCBCXKpueweCwDSf_Q4_MwVA3IbJd04FSxnknLnMHTk,5567
|
118
119
|
torch_geometric/datasets/mixhop_synthetic_dataset.py,sha256=4NNvTHUvvV6pcqQCyVDS5XhppXUeF2H9GTfFoc49eyU,3951
|
119
120
|
torch_geometric/datasets/mnist_superpixels.py,sha256=o2ArbZ0_OE0u8VCaHmWwvngESlOFr9oM9dSEP_tjAS4,3340
|
120
121
|
torch_geometric/datasets/modelnet.py,sha256=-qmLjlQiKVWmtHefAIIE97dQxEcaBfetMJnvgYZuwkg,5347
|
@@ -637,7 +638,7 @@ torch_geometric/utils/undirected.py,sha256=H_nfpI0_WluOG6VfjPyldvcjL4w5USAKWu2x5
|
|
637
638
|
torch_geometric/visualization/__init__.py,sha256=b-HnVesXjyJ_L1N-DnjiRiRVf7lhwKaBQF_2i5YMVSU,208
|
638
639
|
torch_geometric/visualization/graph.py,sha256=mfZHXYfiU-CWMtfawYc80IxVwVmtK9hbIkSKhM_j7oI,14311
|
639
640
|
torch_geometric/visualization/influence.py,sha256=CWMvuNA_Nf1sfbJmQgn58yS4OFpeKXeZPe7kEuvkUBw,477
|
640
|
-
pyg_nightly-2.7.0.
|
641
|
-
pyg_nightly-2.7.0.
|
642
|
-
pyg_nightly-2.7.0.
|
643
|
-
pyg_nightly-2.7.0.
|
641
|
+
pyg_nightly-2.7.0.dev20250523.dist-info/licenses/LICENSE,sha256=ic-27cMJc1kWoMEYncz3Ya3Ur2Bi3bNLWib2DT763-o,1067
|
642
|
+
pyg_nightly-2.7.0.dev20250523.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
643
|
+
pyg_nightly-2.7.0.dev20250523.dist-info/METADATA,sha256=XmGjWnQyn7JYMg0nbBui3cBtMAOzlbVqR-Q5iXFK-I4,62952
|
644
|
+
pyg_nightly-2.7.0.dev20250523.dist-info/RECORD,,
|
torch_geometric/__init__.py
CHANGED
@@ -31,7 +31,7 @@ from .lazy_loader import LazyLoader
|
|
31
31
|
contrib = LazyLoader('contrib', globals(), 'torch_geometric.contrib')
|
32
32
|
graphgym = LazyLoader('graphgym', globals(), 'torch_geometric.graphgym')
|
33
33
|
|
34
|
-
__version__ = '2.7.0.
|
34
|
+
__version__ = '2.7.0.dev20250523'
|
35
35
|
|
36
36
|
__all__ = [
|
37
37
|
'Index',
|
@@ -30,6 +30,7 @@ from .faust import FAUST
|
|
30
30
|
from .dynamic_faust import DynamicFAUST
|
31
31
|
from .shapenet import ShapeNet
|
32
32
|
from .modelnet import ModelNet
|
33
|
+
from .medshapenet import MedShapeNet
|
33
34
|
from .coma import CoMA
|
34
35
|
from .shrec2016 import SHREC2016
|
35
36
|
from .tosca import TOSCA
|
@@ -147,6 +148,7 @@ homo_datasets = [
|
|
147
148
|
'DynamicFAUST',
|
148
149
|
'ShapeNet',
|
149
150
|
'ModelNet',
|
151
|
+
'MedShapeNet',
|
150
152
|
'CoMA',
|
151
153
|
'SHREC2016',
|
152
154
|
'TOSCA',
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import os
|
2
|
+
import os.path as osp
|
3
|
+
from typing import Callable, List, Optional
|
4
|
+
|
5
|
+
import numpy as np
|
6
|
+
import torch
|
7
|
+
|
8
|
+
from torch_geometric.data import Data, InMemoryDataset
|
9
|
+
|
10
|
+
|
11
|
+
class MedShapeNet(InMemoryDataset):
|
12
|
+
r"""The MedShapeNet datasets from the `"MedShapeNet -- A Large-Scale
|
13
|
+
Dataset of 3D Medical Shapes for Computer Vision"
|
14
|
+
<https://arxiv.org/abs/2308.16139>`_ paper,
|
15
|
+
containing 8 different type of structures (classes).
|
16
|
+
|
17
|
+
.. note::
|
18
|
+
|
19
|
+
Data objects hold mesh faces instead of edge indices.
|
20
|
+
To convert the mesh to a graph, use the
|
21
|
+
:obj:`torch_geometric.transforms.FaceToEdge` as :obj:`pre_transform`.
|
22
|
+
To convert the mesh to a point cloud, use the
|
23
|
+
:obj:`torch_geometric.transforms.SamplePoints` as :obj:`transform` to
|
24
|
+
sample a fixed number of points on the mesh faces according to their
|
25
|
+
face area.
|
26
|
+
|
27
|
+
Args:
|
28
|
+
root (str): Root directory where the dataset should be saved.
|
29
|
+
size (int): Number of invividual 3D structures to download per
|
30
|
+
type (classes).
|
31
|
+
transform (callable, optional): A function/transform that takes in an
|
32
|
+
:obj:`torch_geometric.data.Data` object and returns a transformed
|
33
|
+
version. The data object will be transformed before every access.
|
34
|
+
(default: :obj:`None`)
|
35
|
+
pre_transform (callable, optional): A function/transform that takes in
|
36
|
+
an :obj:`torch_geometric.data.Data` object and returns a
|
37
|
+
transformed version. The data object will be transformed before
|
38
|
+
being saved to disk. (default: :obj:`None`)
|
39
|
+
pre_filter (callable, optional): A function that takes in an
|
40
|
+
:obj:`torch_geometric.data.Data` object and returns a boolean
|
41
|
+
value, indicating whether the data object should be included in the
|
42
|
+
final dataset. (default: :obj:`None`)
|
43
|
+
force_reload (bool, optional): Whether to re-process the dataset.
|
44
|
+
(default: :obj:`False`)
|
45
|
+
"""
|
46
|
+
def __init__(
|
47
|
+
self,
|
48
|
+
root: str,
|
49
|
+
size: int = 100,
|
50
|
+
transform: Optional[Callable] = None,
|
51
|
+
pre_transform: Optional[Callable] = None,
|
52
|
+
pre_filter: Optional[Callable] = None,
|
53
|
+
force_reload: bool = False,
|
54
|
+
) -> None:
|
55
|
+
self.size = size
|
56
|
+
super().__init__(root, transform, pre_transform, pre_filter,
|
57
|
+
force_reload=force_reload)
|
58
|
+
|
59
|
+
path = self.processed_paths[0]
|
60
|
+
self.load(path)
|
61
|
+
|
62
|
+
@property
|
63
|
+
def raw_file_names(self) -> List[str]:
|
64
|
+
return [
|
65
|
+
'3DTeethSeg', 'CoronaryArteries', 'FLARE', 'KITS', 'PULMONARY',
|
66
|
+
'SurgicalInstruments', 'ThoracicAorta_Saitta', 'ToothFairy'
|
67
|
+
]
|
68
|
+
|
69
|
+
@property
|
70
|
+
def processed_file_names(self) -> List[str]:
|
71
|
+
return ['dataset.pt']
|
72
|
+
|
73
|
+
@property
|
74
|
+
def raw_paths(self) -> List[str]:
|
75
|
+
r"""The absolute filepaths that must be present in order to skip
|
76
|
+
downloading.
|
77
|
+
"""
|
78
|
+
return [osp.join(self.raw_dir, f) for f in self.raw_file_names]
|
79
|
+
|
80
|
+
def process(self) -> None:
|
81
|
+
import urllib3
|
82
|
+
from MedShapeNet import MedShapeNet as msn
|
83
|
+
|
84
|
+
msn_instance = msn(timeout=120)
|
85
|
+
|
86
|
+
urllib3.HTTPConnectionPool("medshapenet.ddns.net", maxsize=50)
|
87
|
+
|
88
|
+
list_of_datasets = msn_instance.datasets(False)
|
89
|
+
list_of_datasets = list(
|
90
|
+
filter(
|
91
|
+
lambda x: x not in [
|
92
|
+
'medshapenetcore/ASOCA', 'medshapenetcore/AVT',
|
93
|
+
'medshapenetcore/AutoImplantCraniotomy',
|
94
|
+
'medshapenetcore/FaceVR'
|
95
|
+
], list_of_datasets))
|
96
|
+
|
97
|
+
subset = []
|
98
|
+
for dataset in list_of_datasets:
|
99
|
+
self.newpath = self.root + '/' + dataset.split("/")[1]
|
100
|
+
if not os.path.exists(self.newpath):
|
101
|
+
os.makedirs(self.newpath)
|
102
|
+
stl_files = msn_instance.dataset_files(dataset, '.stl')
|
103
|
+
subset.extend(stl_files[:self.size])
|
104
|
+
|
105
|
+
for stl_file in stl_files[:self.size]:
|
106
|
+
msn_instance.download_stl_as_numpy(bucket_name=dataset,
|
107
|
+
stl_file=stl_file,
|
108
|
+
output_dir=self.newpath,
|
109
|
+
print_output=False)
|
110
|
+
|
111
|
+
class_mapping = {
|
112
|
+
'3DTeethSeg': 0,
|
113
|
+
'CoronaryArteries': 1,
|
114
|
+
'FLARE': 2,
|
115
|
+
'KITS': 3,
|
116
|
+
'PULMONARY': 4,
|
117
|
+
'SurgicalInstruments': 5,
|
118
|
+
'ThoracicAorta_Saitta': 6,
|
119
|
+
'ToothFairy': 7
|
120
|
+
}
|
121
|
+
|
122
|
+
for dataset, path in zip([subset], self.processed_paths):
|
123
|
+
data_list = []
|
124
|
+
for item in dataset:
|
125
|
+
class_name = item.split("/")[0]
|
126
|
+
item = item.split("stl")[0]
|
127
|
+
target = class_mapping[class_name]
|
128
|
+
file = osp.join(self.root, item + 'npz')
|
129
|
+
|
130
|
+
data = np.load(file)
|
131
|
+
pre_data_list = Data(
|
132
|
+
pos=torch.tensor(data["vertices"], dtype=torch.float),
|
133
|
+
face=torch.tensor(data["faces"],
|
134
|
+
dtype=torch.long).t().contiguous())
|
135
|
+
pre_data_list.y = torch.tensor([target], dtype=torch.long)
|
136
|
+
data_list.append(pre_data_list)
|
137
|
+
|
138
|
+
if self.pre_filter is not None:
|
139
|
+
data_list = [d for d in data_list if self.pre_filter(d)]
|
140
|
+
|
141
|
+
if self.pre_transform is not None:
|
142
|
+
data_list = [self.pre_transform(d) for d in data_list]
|
143
|
+
|
144
|
+
self.save(data_list, path)
|
File without changes
|
{pyg_nightly-2.7.0.dev20250521.dist-info → pyg_nightly-2.7.0.dev20250523.dist-info}/licenses/LICENSE
RENAMED
File without changes
|