|
@@ -11,7 +11,7 @@ class IPFSDataset(Dataset):
|
|
|
def __init__(self, cid, transform=None, target_transform=None, url="http://127.0.0.1:5001/api/v0"):
|
|
def __init__(self, cid, transform=None, target_transform=None, url="http://127.0.0.1:5001/api/v0"):
|
|
|
"""
|
|
"""
|
|
|
Args:
|
|
Args:
|
|
|
- cid (string): IPFS Directory CID with all the files.
|
|
|
|
|
|
|
+ cid (string): IPFS Directory CID with all the sub directories (categories) & files.
|
|
|
url (string): IPFS base URL
|
|
url (string): IPFS base URL
|
|
|
transform (callable, optional): Optional transform to be applied
|
|
transform (callable, optional): Optional transform to be applied
|
|
|
on a sample.
|
|
on a sample.
|
|
@@ -28,7 +28,6 @@ class IPFSDataset(Dataset):
|
|
|
self.classes.sort()
|
|
self.classes.sort()
|
|
|
self.class_to_idx = {self.classes[i]
|
|
self.class_to_idx = {self.classes[i]
|
|
|
: i for i in range(len(self.classes))}
|
|
: i for i in range(len(self.classes))}
|
|
|
- print(self.class_to_idx)
|
|
|
|
|
for member in tar.getmembers():
|
|
for member in tar.getmembers():
|
|
|
if member.isfile:
|
|
if member.isfile:
|
|
|
extractedFile = tar.extractfile(member)
|
|
extractedFile = tar.extractfile(member)
|